Seven lines came out of the test service called gunicorn, and journalctl -u webapp.service printed five of them. Nothing was deleted, nothing was rotated, and the two missing lines were still sitting in the journal, findable by another filter. The gap comes from a race inside journald, and it sits under every filter the systemd journal offers, by unit, by time window, by priority and by boot.
The test box and the log it produced
An honest container, a handful of fake services, and real output
Everything below was run on an Ubuntu 24.04 test container with systemd 255. A container is not a booted machine, so there was no systemd acting as PID 1. The journal daemon, systemd-journald, was started by hand, and two small test emitters were placed in control groups named system.slice/backup.service and system.slice/webapp.service so that journald would tag their lines with those unit names, the same way it tags a real service. One emitter pretended to be a nightly rsync job. The other pretended to be a gunicorn web app with a SQLite problem. The log lines are invented test messages, and the container clock was run fast so that a few minutes of real time covered a night of timestamps; the journalctl output is what the commands actually printed.
The journal does not care what wrote a line. What it keeps track of is metadata, the trusted fields journald attaches to every entry, and each filter below is a match against those fields.
The man page says it directly: -u adds a match for messages from the unit, plus matches for systemd’s own messages about it and for coredumps, according to the journalctl manual. Under the hood, that match is a field called _SYSTEMD_UNIT.

Filter by service with -u
The first filter anyone needs, and the one that hides the most
On the test container:
$ journalctl -u webapp.service
Nov 24 02:48:53 vm gunicorn[6373]: Listening at: http://127.0.0.1:8000
Nov 24 03:40:22 vm gunicorn[6456]: sqlite3.OperationalError: database is locked
Nov 24 04:07:50 vm gunicorn[6488]: Worker (pid:4412) was sent SIGKILL! Perhaps out of memory?
Nov 24 04:09:30 vm gunicorn[6492]: Booting worker with pid: 4519
Nov 24 05:12:09 vm gunicorn[6572]: Worker timeout (pid:4519)
The .service suffix is optional; journalctl -u webapp matched the same unit. Pass -u more than once to watch two services interleaved on one timeline, which is how a backup job that hammers the disk at 2 a.m. gets caught next to the web app that started timing out at 2 a.m.
$ journalctl -u backup.service -u webapp.service -p warning
Nov 24 02:24:56 vm backup.sh[6318]: rsync: file has vanished: /home/app/cache/session-91.tmp
Nov 24 03:40:22 vm gunicorn[6456]: sqlite3.OperationalError: database is locked
Nov 24 04:07:50 vm gunicorn[6488]: Worker (pid:4412) was sent SIGKILL! Perhaps out of memory?
Nov 24 05:04:51 vm backup.sh[6548]: rsync error: some files could not be transferred (code 23)
Nov 24 05:12:09 vm gunicorn[6572]: Worker timeout (pid:4519)
To see which units the journal even knows about, -F prints every value a field has ever taken. The manual describes it as printing “all possible data values the specified field can take in all entries of the journal” (journalctl manual).
$ journalctl -F _SYSTEMD_UNIT
webapp.service
backup.service
A misspelled unit name does not raise an error. It prints -- No entries --, exactly as it would for a real service that has been quiet all day. That is a landline with no dial tone and no busy signal either, and it is worth running -F _SYSTEMD_UNIT once before believing silence.
Filter by priority with -p
Eight levels, numbered backward, and a range syntax most people never use
Syslog priorities run from 0 (emerg) to 7 (debug). The manual says -p takes “either a single numeric or textual log level,” and that a single level also shows everything more important than it (journalctl manual). So -p err means err, crit, alert and emerg, and -p 3 means the same thing.
$ journalctl -u webapp.service -p err
Nov 24 03:40:22 vm gunicorn[6456]: sqlite3.OperationalError: database is locked
Nov 24 04:07:50 vm gunicorn[6488]: Worker (pid:4412) was sent SIGKILL! Perhaps out of memory?
The range form FROM..TO includes both ends, which is the way to look at the warnings and errors without the crit-level noise drowning them, or the opposite:
$ journalctl -p warning..err
Nov 24 02:24:56 vm backup.sh[6318]: rsync: file has vanished: /home/app/cache/session-91.tmp
Nov 24 03:40:22 vm gunicorn[6456]: sqlite3.OperationalError: database is locked
Nov 24 03:42:58 vm gunicorn[6465]: sqlite3.OperationalError: database is locked
Nov 24 05:04:51 vm backup.sh[6548]: rsync error: some files could not be transferred (code 23)
Nov 24 05:12:09 vm gunicorn[6572]: Worker timeout (pid:4519)
The SIGKILL line is missing there because it was logged at crit, one step above the top of the range. Look closely at the timestamps, too. That second database is locked at 03:42:58 shows up here and did not show up under -u webapp.service. Hold that thought.
Priority is only as honest as the program that set it. In this test every level was assigned by hand with systemd-cat -p; in the wild, a script that never sets a level sends its worst traceback at whatever level its logging path hands out by default. The -p filter sorts by what the program claimed, not by what happened.

Filter by time with –since and –until
Absolute stamps, relative offsets, and the words “today” and “yesterday”
The time filters take YYYY-MM-DD HH:MM:SS; leave off the time and midnight is assumed, leave off the seconds and :00 is assumed. The strings “yesterday,” “today,” “tomorrow” and “now” all work, and relative times take a - or + prefix, such as -1h (journalctl manual).
An hour-wide window around the moment the worker died:
$ journalctl --since '2026-11-24 03:30' --until '2026-11-24 04:30'
Nov 24 03:40:22 vm gunicorn[6456]: sqlite3.OperationalError: database is locked
Nov 24 03:42:58 vm gunicorn[6465]: sqlite3.OperationalError: database is locked
Nov 24 04:07:50 vm gunicorn[6488]: Worker (pid:4412) was sent SIGKILL! Perhaps out of memory?
Nov 24 04:09:30 vm gunicorn[6492]: Booting worker with pid: 4519
And a relative one, run with the container clock at 05:50, combined with a priority floor:
$ journalctl -S -2h -p warning
Nov 24 04:07:50 vm gunicorn[6488]: Worker (pid:4412) was sent SIGKILL! Perhaps out of memory?
Nov 24 05:04:51 vm backup.sh[6548]: rsync error: some files could not be transferred (code 23)
Nov 24 05:12:09 vm gunicorn[6572]: Worker timeout (pid:4519)
Filters stack. Unit, priority and time all narrow the same result, so the habit worth building is to start wide and add one flag at a time until the screen holds only the lines that matter. For a timeline with less clutter, -o short-iso prints RFC 3339 timestamps with the UTC offset, which matters the first time logs from two machines in different time zones get pasted into the same ticket. -o cat drops everything but the message. -r reverses the order so the newest line is on top, and -n 1 prints only the last entry:
$ journalctl -u webapp.service -n 1
Nov 24 05:12:09 vm gunicorn[6572]: Worker timeout (pid:4519)
For text inside the message, -g takes a PCRE pattern. A pattern written entirely in lowercase matches case-insensitively, and one with any capital letter becomes case-sensitive, per the manual. That rule is clever right up until someone types -g Locked and gets nothing.
$ journalctl -u webapp.service -g 'locked|SIGKILL'
Nov 24 03:40:22 vm gunicorn[6456]: sqlite3.OperationalError: database is locked
Nov 24 04:07:50 vm gunicorn[6488]: Worker (pid:4412) was sent SIGKILL! Perhaps out of memory?
Filter by boot with -b, and the journal that forgets
Boot offsets are simple; whether the last boot was saved is not
-b adds a _BOOT_ID= match. With no argument it means the current boot, 0 is the last boot, -1 is the one before, and positive numbers count forward from the oldest boot in the journal (journalctl manual). The machine that rebooted itself at 3 a.m. is a journalctl -b -1 -p err question, and --list-boots shows which offsets exist.
On the test container:
$ journalctl --list-boots
IDX BOOT ID FIRST ENTRY LAST ENTRY
0 3add160e3dbb43f7b322fbde9c85364e Tue 2026-11-24 02:00:22 EST Tue 2026-11-24 05:43:54 EST
$ journalctl -b -1
Specifying boot ID or boot offset has no effect, no persistent journal was found.
The second message is the expensive one. This journal lived in /run/log/journal, which is memory-backed, so a reboot wipes it. The journald.conf manual explains the setting behind it: with Storage=auto, journald behaves like “persistent” if the /var/log/journal directory exists, and “volatile” otherwise. A box with no /var/log/journal directory keeps its logs exactly as long as the power stays on, which means the one boot anyone wants to read, the one that crashed, is gone.
Check before it matters: ls -d /var/log/journal, and journalctl --disk-usage to see the size. On the test box it reported Archived and active journals take up 8.0M in the file system. The same manual says the default size caps are 10% of the filesystem for persistent storage and 15% for runtime storage, each capped at 4G. Kernel messages for the current boot come out with -k, which adds _TRANSPORT=kernel, and it is often the faster way to find the OOM killer’s handwriting than any service filter.

Where people get burned
The unit filter is a match on metadata, and metadata can be missing
Back to the two missing lines. Asking for the gunicorn lines by their syslog identifier instead of by unit:
$ journalctl -u webapp.service -o cat | wc -l
5
$ journalctl -t gunicorn -o cat | wc -l
7
The verbose view shows why. Most entries carried _SYSTEMD_UNIT=webapp.service. Two did not, including the Booting worker with pid: 4412 line, which had a PID and a transport but no unit field at all. One of the four backup lines, the “starting nightly rsync” message, was missing its unit tag too. Every test emitter in this run was a process that wrote one line and exited at once.
The race is documented. Lennart Poettering described it on the systemd-devel mailing list in 2020: if a process logs and exits quickly, journald may handle the message “after the process already exited, i.e. at a time where we can’t read the cgroup off the process anymore” (systemd-devel, July 28, 2020). Without the cgroup, journald cannot work out the unit. The line is kept; the label is not. In the same thread he suggested having the program run the equivalent of journalctl --sync before exiting, and called a sleep-before-exit workaround racy.
The practical rule: for short-lived jobs, oneshot units and anything fired by a timer, search by -t (the SYSLOG_IDENTIFIER field) or by -g as well as by -u. A service that crashes in its first few milliseconds produces exactly the kind of short-lived process that loses its label, so the moment the unit filter is most likely to come back thin is the moment it matters most.
The other burns are quieter:
- Rate limiting. journald.conf describes per-service limits: when a service logs more than
RateLimitBurst=messages insideRateLimitIntervalSec=, further messages in that interval are dropped, and a message about the number dropped is written (journald.conf manual). A loop spewing a stack trace can make its own evidence vanish. Search for the “suppressed” notice before assuming a service went quiet. - Vacuuming the wrong thing.
--vacuum-size=and--vacuum-time=only remove archived journal files; the manual is explicit that active files are never removed. Runningjournalctl --vacuum-size=100Mon a full disk and seeing little change is normal, and--rotatefirst is how the active file becomes archivable. -xin bug reports. The-xflag adds catalog help text, and the manual advises against using it when attaching output to bug reports. It pads a paste with boilerplate the person helping does not need.
The commands, side by side
A short reference built from the runs above
| Task | Command | Matches on |
|---|---|---|
| One service | journalctl -u webapp.service |
_SYSTEMD_UNIT (plus systemd’s messages about it) |
| Same program, unit tag or not | journalctl -t gunicorn |
SYSLOG_IDENTIFIER |
| Errors and worse | journalctl -p err |
PRIORITY 0 to 3 |
| Warnings to errors only | journalctl -p warning..err |
PRIORITY 3 to 4 |
| Time window | journalctl -S '2026-11-24 03:30' -U '2026-11-24 04:30' |
entry timestamp |
| Last two hours | journalctl -S -2h |
entry timestamp |
| Previous boot | journalctl -b -1 |
_BOOT_ID (needs a saved journal) |
| Kernel only | journalctl -k |
_TRANSPORT=kernel |
| Text search | journalctl -g 'locked' |
MESSAGE, PCRE |
| Raw field match | journalctl _SYSTEMD_UNIT=backup.service PRIORITY=3 |
any field |
The last row is where the flags come from. Each one is a shorthand for a FIELD=value match, and the raw form works for any field the verbose output shows:
$ journalctl _SYSTEMD_UNIT=backup.service PRIORITY=3
Nov 24 05:04:51 vm backup.sh[6548]: rsync error: some files could not be transferred (code 23)
Scheduled jobs are the likeliest to lose their unit tag, because their processes live for a second and leave, and the x9m8 comparison of systemd timers vs cron covers how those jobs get set up. A worker sent SIGKILL with “Perhaps out of memory?” points at memory pressure, which is the territory of the x9m8 piece on compressed RAM in Linux, zram and zswap.
The journal kept all seven gunicorn lines. Only five of them knew where they came from, and the filter most people type first asks the journal where things came from. How many of the crash investigations that ended in “nothing in the logs” were really a unit filter looking past the two lines that mattered?
Sources
- journalctl manual, freedesktop.org: https://www.freedesktop.org/software/systemd/man/latest/journalctl.html
- journald.conf manual, freedesktop.org: https://www.freedesktop.org/software/systemd/man/latest/journald.conf.html
- Lennart Poettering, “journald not associating log messages with service,” systemd-devel mailing list, July 28, 2020: https://lists.freedesktop.org/archives/systemd-devel/2020-July/044929.html
