Cheat Sheets

journalctl Cheat Sheet: Filter, Follow and Trim Linux Logs

journalctl does not search log files the way grep searches /var/log/syslog. It queries an indexed binary journal, and every filter you type is a match on a field that journald stored next to the message. That is why journalctl -u nosuchservice prints -- No entries -- and exits 0 instead of failing, and why _COMM=sshd no longer finds a single SSH login on a current distro.

Original content from computingforgeeks.com - post 194420

This journalctl cheat sheet starts with a quick reference, then follows the fields through units, invocations, boots, priorities, time windows, output formats, storage, vacuuming and journals shipped from other hosts. Everything below was run on Ubuntu 26.04, Rocky Linux 10 and Fedora 45 in November 2026, and each place where the three disagree is called out.

journalctl cheat sheet (quick reference)

Each table groups the commands by the job you are doing, so you can scan for the task rather than the flag. UNIT stands for a service name such as ssh or nginx, and the sections after the tables show what most of these commands printed on the lab machines.

Read and page the journal

CommandWhat it does
journalctlWhole journal, oldest first, in a pager
journalctl -eJump to the end of the pager
journalctl -n 50Last 50 entries
journalctl -rNewest first
journalctl -fFollow new entries live
journalctl --no-pagerPrint straight to the terminal or a pipe
journalctl -xAdd catalog explanations to known messages
journalctl -qHide hints and info lines

Filter by unit, invocation and boot

CommandWhat it does
journalctl -u UNITOne service, including its child processes
journalctl -xeu UNITLatest unit logs with explanations
journalctl -u UNIT --list-invocationsEach start of the unit with its ID
journalctl -u UNIT -IOnly the latest run of the unit
journalctl -u UNIT --invocation=-1The run before the latest one
journalctl --list-bootsBoots stored in the journal
journalctl -bCurrent boot only
journalctl -b -1Previous boot
journalctl -kKernel messages, current boot
journalctl --user -u UNITA user service of your own

Filter by process, user and field

CommandWhat it does
journalctl _PID=2459Entries from one process ID
journalctl _UID=1000Entries from one user ID
journalctl _COMM=sshd-sessionEntries from one executable name
journalctl -t TAGOne syslog identifier
journalctl -T TAGExclude a syslog identifier
journalctl _HOSTNAME=client01One host in a merged or remote journal
journalctl -NList every field name in use
journalctl -F _SYSTEMD_UNITList the values one field holds
journalctl A=x + B=yOR two match groups together

Priority, time and text

CommandWhat it does
journalctl -p err -berr and worse, current boot
journalctl -p warning..errOnly warning, err and the levels between
journalctl --since "10 min ago"Relative start time
journalctl --since "2026-11-23 07:50" --until "+0"Absolute window up to now
journalctl --since todaySince midnight
journalctl -g 'fail'Regex on MESSAGE, case-insensitive if all lowercase
journalctl -g 'S3' --case-sensitive=falseForce a case-insensitive match
journalctl --facility=helpList syslog facilities to filter on

Output formats

CommandWhat it does
journalctl -o catMessage text only
journalctl -o short-isoISO 8601 timestamps with time zone
journalctl -o short-preciseMicrosecond timestamps
journalctl -o with-unitPrefix lines with the unit name
journalctl -o verboseEvery field of every entry
journalctl -o jsonOne JSON object per line
journalctl -o json-prettyIndented JSON for reading
journalctl -o json --output-fields=MESSAGE,PRIORITYTrim JSON to chosen fields (plus cursor fields)

Storage, disk use and cleanup

CommandWhat it does
journalctl --disk-usageSpace used by archived and active files
sudo journalctl --rotateArchive the active files now
sudo journalctl --vacuum-size=500MDelete oldest archives down to a size
sudo journalctl --vacuum-time=2weeksDelete archives older than a span
sudo journalctl --vacuum-files=5Keep at most N archived files
sudo journalctl --flushMove the RAM journal to /var/log/journal
sudo journalctl --verifyCheck journal files for corruption
sudo journalctl --headerFile path, flags and sizes of the journal
systemd-analyze cat-config systemd/journald.confEffective journald settings with drop-ins

Remote and other journals

CommandWhat it does
journalctl -D /var/log/journal/remoteRead a directory of journal files
journalctl --file=FILE.journalRead one journal file
journalctl -mMerge local and remote journals
journalctl -M CONTAINERJournal of a running local container
sudo systemctl enable --now systemd-journal-remote.socketReceive journals on port 19532 (needs TLS certs or the HTTP override below)
sudo systemctl enable --now systemd-journal-uploadSend this host’s journal to the receiver

Unit control itself (start, enable, edit, timers) lives in the companion systemctl cheat sheet, because the two tools split the work: systemctl changes state and journalctl tells you what happened. The rest of our printable references are collected on the cheat sheets hub.

Every filter is a field match

Options such as -u and -t are shortcuts for matches on stored fields. You can type any field directly as FIELD=value, so the useful question is which fields your journal actually holds. -N lists the names and -F lists the values one of them takes:

journalctl -N | wc -l
journalctl -F _SYSTEMD_UNIT | sort | head -8

The fresh Ubuntu VM reported 85 field names. Rocky reported 88 and Fedora 144, because the count depends on what has logged so far rather than on the distro. The -F list is the quickest way to get a unit’s exact name before you filter on it:

85
apparmor.service
chrony.service
cloud-init-main.service
cron.service
dbus.service
gce-workload-cert-refresh.service
google-guest-agent.service
google-osconfig-agent.service

Three rules decide how several matches combine, and most empty results that look like a quiet service are one of them:

  1. Matches on different fields are ANDed.
  2. Two matches on the same field are ORed.
  3. A lone + ORs the groups on either side.

So _UID=0 -t jdemo returned nothing in the lab, because the test lines were written by the kenneth account and both fields had to match. Swapping in that user’s ID found them. The SSH case is the same trap with a twist, since OpenSSH now runs each login in its own sshd-session binary and only the listener still logs as sshd. On Ubuntu and Rocky _COMM=sshd returned the two “Server listening” lines and nothing else, and on Fedora it returned no entries at all. The logins sit under the new command name:

journalctl _COMM=sshd-session -n 2 --no-pager

This is the query you want on the Rocky box. If you still have alert rules or fail2ban jails that match on _COMM=sshd, they stopped seeing logins the day this OpenSSH landed, and nothing in their output tells you so:

Nov 23 07:47:25 gw01 sshd-session[5404]: Accepted publickey for kenneth from 203.0.113.10 port 49892 ssh2: ED25519 SHA256:...
Nov 23 07:47:25 gw01 sshd-session[5404]: pam_unix(sshd:session): session opened for user kenneth(uid=1000) by kenneth(uid=0)

-u ssh on Ubuntu and -u sshd on Rocky and Fedora still catch those lines, because the unit match follows the service’s cgroup rather than the executable name. That makes the unit filter the safer default for anything systemd runs. Keep raw fields for the things a unit doesn’t describe, such as one PID, one user ID or one host in a shared journal.

Units split into invocations

-u UNIT returns every run the journal still holds, so a service that restarted ten times mixes ten runs into one stream. Which of those lines belong to the run that just failed? Each start gets an invocation ID, and journalctl can list and select by it. To have something to look at, the lab started a transient unit that fails on purpose:

sudo systemd-run --unit=jdemo /bin/sh -c 'echo "jdemo: starting worker"; echo "jdemo: cannot open /etc/jdemo.conf" >&2; exit 3'

systemd answers with the invocation ID before the shell has even run. It is the same value that --invocation= accepts later, so a deploy script can record it and pull exactly that run’s logs if the health check fails:

Running as unit: jdemo.service; invocation ID: a0f43c62e3794234a0e5e7d1116daeef

journalctl -xeu jdemo shows the failure with the catalog text that -x adds. The ░░ lines aren’t part of the log entry, because journalctl looks up the message ID in its catalog and prints the explanation at read time. That is why the support URL differs per distro (Ubuntu points at ubuntu.com, Rocky at its wiki) even though the entry itself is identical. The tail of the Ubuntu output shows you both parts.

░░ The process' exit code is 'exited' and its exit status is 3.
Nov 23 07:50:34 client01 systemd[1]: jdemo.service: Failed with result 'exit-code'.
░░ Subject: Unit failed
░░ Defined-By: systemd
░░ Support: http://www.ubuntu.com/support
░░
░░ The unit jdemo.service has entered the 'failed' state with result 'exit-code'.

Running the same transient unit again while it sits in the failed state is refused, and systemd-run exits 1. The message, Failed to start transient service unit: Unit jdemo.service was already loaded or has a fragment file., sounds like a config clash. It isn’t. The failed unit simply keeps its name until you clear it, so reset it and then start the second run.

sudo systemctl reset-failed jdemo
sudo systemd-run --unit=jdemo --property=Type=exec /bin/sh -c 'echo "jdemo: starting worker"; sleep 1; echo "jdemo: done"'

With two runs stored, the invocation flags do three different jobs:

  • --list-invocations numbers every run, 0 for the newest.
  • -I shows only the latest run.
  • --invocation=-1 picks an older run by offset or ID.

The offset is what makes the list useful, since it pulls the failed run back without the clean one mixed in. List the runs, then ask for the one before the latest:

journalctl -u jdemo --list-invocations --no-pager
journalctl -u jdemo --invocation=-1 --no-pager

On Ubuntu the list showed both IDs with their first and last entry times (the screenshot comes from an earlier pass with Type=exec on both runs, so its IDs differ from the one above). Offset -1 returned the six lines of the run that exited with status 3, and none of the clean run’s lines:

journalctl --list-invocations and --invocation=-1 showing the failed earlier run of jdemo.service on Ubuntu 26.04

-I is the flag to reach for right after a restart, when you only care whether the new run came up. Rocky’s older systemd has both --list-invocations and -I as well, so these commands work the same on all three machines. If an older host rejects them, fall back to --since with the restart time, which is less exact but works everywhere.

A unit name that doesn’t exist isn’t an error to journalctl. journalctl -u nosuchservice printed -- No entries -- and returned 0, so a script that checks the exit code learns nothing from a typo. Confirm the name with journalctl -F _SYSTEMD_UNIT or systemctl list-units before you trust an empty result, especially on Ubuntu where the SSH unit is ssh and not sshd.

Boots need a persistent journal

-b -1 only works when the previous boot was written to disk. On a volatile journal the list holds a single boot, so the “why did it restart last night” question has no answer at all. After both lab VMs were rebooted with persistent storage on, the list showed two boots and the previous boot still held the failed jdemo run:

journalctl --list-boots --no-pager
journalctl -b -1 -u jdemo -n 3 --no-pager
journalctl -b -1 -n 4 --no-pager

The last four lines of boot -1 are the shutdown itself, ending in Journal stopped. These are the lines you check after an unexpected restart, because a clean shutdown always ends with that line, even though the lines before it vary (Rocky showed journald receiving SIGTERM instead of Shutting down.). A power loss or kernel panic leaves the boot ending mid-stream with no shutdown lines, so their absence is the evidence:

Nov 23 07:51:30 client01 systemd[1]: Shutting down.
Nov 23 07:51:31 client01 systemd-shutdown[1]: Syncing filesystems and block devices.
Nov 23 07:51:31 client01 systemd-shutdown[1]: Sending SIGTERM to remaining processes...
Nov 23 07:51:31 client01 systemd-journald[1794]: Journal stopped

The screenshot adds the boot list and the -b -1 -u jdemo query from the Ubuntu box, under the permission hint covered later. Negative numbers count back from the current boot, and the long boot ID from the list works in place of the number. Use the ID in tickets, since “-1” points at a different boot as soon as the machine restarts again:

journalctl permission hint for a user outside adm, then --list-boots and -b -1 on Ubuntu 26.04

Kernel messages follow the same boot logic. journalctl -k is dmesg for the current boot, while journalctl -k -b -1 gives you the one view dmesg can’t, because the kernel ring buffer was emptied by the reboot. On the Ubuntu VM -k also surfaced AppArmor DENIED audit lines, which is where you look first when a confined program fails without saying why.

Priorities filter by ceiling

-p err doesn’t mean “only errors”. It means err and everything more severe, so crit, alert and emerg come along with it. The levels are the syslog ones, and the number is what the PRIORITY field stores, which matters once you read JSON output.

NumberNameIncluded by -p err
0emergyes
1alertyes
2crityes
3erryes
4warningno
5noticeno
6infono
7debugno

To test it, three lines went into the journal at known levels with systemd-cat and logger. Both are also how you would log from your own scripts, since they set the identifier and priority fields that the filters read:

systemd-cat -t jdemo -p warning echo 'disk /var at 91 percent'
systemd-cat -t jdemo -p err echo 'backup to s3 failed: timeout'
logger -t jdemo -p user.info 'nightly report sent'

A range such as warning..err sets both ends, so it drops the info line and anything more severe than err. On Rocky the range returned exactly the two lines in between. The same screenshot shows the grep case rule from the next section, which is the other half of narrowing a noisy journal:

journalctl priority range warning..err and case-insensitive grep for S3 on Rocky Linux 10

Running journalctl -p err -b on a fresh VM gives you a baseline of noise to ignore later. All three GCP VMs logged the same kernel complaint, piix4_smbus 0000:00:01.3: SMBus base address uninitialized, and Rocky added a chronyd line about the metadata server address. Fedora logged several preset failures from early boot, which you can see here:

journalctl -p err -b --no-pager | tail -5

None of these needs action on a cloud VM, and knowing them up front stops you chasing them during a real incident. The host also changes from localhost to probe partway through, because early boot logs before the hostname is set (the lab renamed this VM later), so keep that in mind before you filter one boot by _HOSTNAME=:

Nov 23 07:53:11 localhost systemd[1]: Failed to preset all unit /etc/systemd/system/sockets.target.wants/systemd-sysupdate-notify-pcrlock.socket: Read-only file system
Nov 23 07:53:11 localhost systemd[1]: Failed to preset all unit /etc/systemd/system/sockets.target.wants/systemd-sysupdate-notify-sysext.socket: Read-only file system
Nov 23 07:53:11 localhost systemd[1]: Failed to preset all unit: Unit /etc/systemd/system/factory-reset.target.wants/systemd-tpm2-clear.service does not exist
Nov 23 07:53:12 localhost kernel: piix4_smbus 0000:00:01.3: SMBus base address uninitialized - upgrade BIOS or use force_addr=0xaddr
Nov 23 07:53:30 probe jdemo[1075]: backup to s3 failed: timeout

Only the last line is ours. In a real incident that is the pattern to look for, the new error that isn’t in your baseline, logged at the time the problem started. So save the output of this command on every new build, because a diff against it is quicker than reading the whole boot when something breaks.

Time windows and grep use smart case

--since and --until read times in the machine’s local time zone, which was UTC on these VMs. They accept three kinds of value:

  • Absolute: "2026-11-23 07:50"
  • Relative: "10 min ago", "-1h", "+0"
  • Words: today, yesterday, now

Mixing an absolute start with a relative end is the common case during an incident, since you know when it began and you want everything up to now:

journalctl -u jdemo --since '2026-11-23 07:50' --until '+0' -o short-iso --no-pager

-o short-iso prints the offset with each timestamp, so there is no doubt about the zone when you paste lines into a ticket. The PID in brackets is a filter of its own as well. journalctl _PID=2459 returned just the two lines the shell wrote, without the systemd lines around them.

2026-11-23T07:50:34+00:00 client01 systemd[1]: Started jdemo.service - [systemd-run] /bin/sh -c "echo \"jdemo: starting worker\"; echo \"jdemo: cannot open /etc/jdemo.conf\" >&2; exit 3".
2026-11-23T07:50:34+00:00 client01 sh[2459]: jdemo: starting worker
2026-11-23T07:50:34+00:00 client01 sh[2459]: jdemo: cannot open /etc/jdemo.conf

-g runs a regular expression against the MESSAGE field, and its case handling catches people out. An all-lowercase pattern matches case-insensitively, so -g 'fail' also found Failed with result. One capital letter flips it to case-sensitive, so -g 'S3' missed backup to s3 failed and printed -- No entries -- on all three distros. Add --case-sensitive=false whenever your pattern has capitals:

journalctl -t jdemo -g 'S3' --no-pager; journalctl -t jdemo -g 'S3' --case-sensitive=false --no-pager

Fedora 45 behaved the same way: the first query came back empty and the second found the line. The screenshot also shows the invocation list and priority range on Fedora’s newer systemd, matching the Ubuntu and Rocky results, so none of this is distro-specific:

journalctl invocations, priority range and smart-case grep on Fedora 45

Follow mode combines with all of these filters. journalctl -f -t jdemo -n 1 printed the last matching line and then waited, and a logger line sent two seconds later appeared at once. Add -T sshd -T systemd to drop chatty identifiers while you follow, or use -r to read newest first when you only need the last few minutes.

Output formats decide what scripts see

The default short format is for eyes, and it drops the priority, unit and invocation of every line. For anything that parses logs, pick the format that carries the field you need. Match the format to the job:

  • -o cat for grep, diff and pasting messages.
  • -o short-iso for tickets and timelines.
  • -o json for scripts and log shippers.
  • -o verbose for finding which field to filter on.

-o cat is the bare message. On Fedora it printed the three test messages and nothing else, with no timestamp or host to strip off:

journalctl -t jdemo -o cat --no-pager

That output is what you want for a quick diff between two hosts, because nothing in it changes from one run to the next except the messages themselves:

disk /var at 91 percent
backup to s3 failed: timeout
nightly report sent

-o json writes one object per line, so it streams straight into any JSON parser without a wrapper. Here Python prints the priority next to each message, which the short format never shows:

journalctl -t jdemo -o json --no-pager | python3 -c 'import sys,json; [print(e["PRIORITY"], e["MESSAGE"]) for e in map(json.loads, sys.stdin)]'

The numbers match the levels the lines were sent with on Ubuntu: 4 for warning, 3 for err and 6 for the info line from logger. Note that the values arrive as strings, so compare them as text or convert them first:

4 disk /var at 91 percent
3 backup to s3 failed: timeout
6 nightly report sent

--output-fields trims JSON, but not completely. Asking for four fields on Fedora still returned the cursor, sequence number, boot ID and both timestamps, because journalctl always adds the fields that locate an entry:

journalctl -t jdemo -n1 -o json-pretty --output-fields=MESSAGE,PRIORITY,SYSLOG_IDENTIFIER,_HOSTNAME

Plan for those extra keys in whatever consumes the output, since a strict schema that expects exactly the fields you named will reject every record. The PRIORITY of 5 is also worth a look: on Fedora the logger line was sent without -p, and logger defaults to notice:

{
	"__SEQNUM" : "1368",
	"_HOSTNAME" : "probe",
	"__CURSOR" : "s=fa0078f7b8e14d1db11253d59821cbbc;i=558;b=9dd163fe84b848809e4d4e2a8101c8e3;m=1a3d097;t=660ece3cbc185;x=5828af395bc7afa3",
	"SYSLOG_IDENTIFIER" : "jdemo",
	"__REALTIME_TIMESTAMP" : "1795420410593669",
	"MESSAGE" : "nightly report sent",
	"PRIORITY" : "5",
	"__SEQNUM_ID" : "fa0078f7b8e14d1db11253d59821cbbc",
	"_BOOT_ID" : "9dd163fe84b848809e4d4e2a8101c8e3",
	"__MONOTONIC_TIMESTAMP" : "27512983"
}

The __CURSOR value is useful in its own right. Save it after a run and pass it back with --after-cursor=, and a cron script reads only the entries that arrived since its last pass, which is how you avoid both gaps and duplicates without tracking timestamps yourself.

Group membership opens the system journal

A regular user sees only their own entries, and on a server that usually means nothing useful. When the lab’s tester account, which belonged to no extra groups, ran journalctl on Ubuntu, it got a hint and then no entries at all, with exit code 1:

Hint: You are currently not seeing messages from other users and the system.
      Users in groups 'adm', 'systemd-journal' can see all messages.
      Pass -q to turn off this notice.
No journal files were opened due to insufficient permissions.

Rocky’s hint lists wheel as well, and the journalctl man page names the same three groups:

  • systemd-journal: reads the journal and nothing else.
  • adm: also reads other logs under /var/log.
  • wheel: usually grants sudo on RHEL-family systems.

Give a monitoring or support account systemd-journal, the narrowest of the three, then have it log out and back in so the new group applies:

sudo usermod -aG systemd-journal tester

Granting adm or wheel just for logs gives away more than you meant to, because distros attach other privileges to both.

Persistent storage depends on one directory

Whether your logs survive a reboot comes down to the Storage= setting and to whether /var/log/journal exists. With auto, journald writes to disk only if the directory is already there, while persistent creates it. Do you know which one your image ships? The three lab images didn’t agree.

Ubuntu 26.04Rocky Linux 10.2Fedora 45
systemd259257262
Shipped Storage= defaultpersistentautopersistent
/var/log/journal on first bootexistsmissingexists
Logs survive reboot out of the imageyesnoyes
Distro-set journald optionForwardToSyslog=yesAudit=none
firewalldnot installedactiveinactive

So a Rocky Linux 10 cloud VM keeps its journal in RAM under /run/log/journal and loses it on every reboot. Our older guide to persistent systemd journal storage creates the directory by hand. A drop-in that sets Storage=persistent does the same job and records the decision in config, so the next admin can see it. Create the drop-in:

sudo mkdir -p /etc/systemd/journald.conf.d
sudo vim /etc/systemd/journald.conf.d/50-persistent.conf

These are the settings the lab used. SystemMaxUse caps the journal at 200 MB, SystemKeepFree keeps 1 GB of the filesystem free for everything else, and MaxRetentionSec drops entries older than a month:

[Journal]
Storage=persistent
SystemMaxUse=200M
SystemKeepFree=1G
MaxRetentionSec=1month

Restart journald, then flush. Without the flush, the entries already in RAM stay there until the next boot, and those are often the ones you set this up to keep:

sudo systemctl restart systemd-journald
sudo journalctl --flush

On Rocky the directory appeared and the reported usage went from 4.2M in RAM to 8M on disk. The new directory is owned by root:root without the journal ACLs, so run sudo systemd-tmpfiles --create --prefix /var/log/journal now, or members of systemd-journal may not read it until the next boot fixes the modes. systemd-analyze cat-config shows the vendor file and the drop-in together. That is how you prove which value wins when several files set the same key, because the last file printed is the one applied last.

Rocky Linux 10 journal moving from /run/log/journal to persistent /var/log/journal after a journald.conf drop-in

journald also reports the limits it settled on in its own startup line, which is easier than doing the 10% and 15% default arithmetic yourself. Ubuntu printed it after the restart, but on Rocky it only showed up after a reboot, so read it then:

journalctl -t systemd-journald -b -n 3 --no-pager

On Rocky, “max 200M, 184M free” means the cap took effect and 16M is already used. If the max shows a different number, a later drop-in or the free-space rule overrode yours, and cat-config will show which:

Nov 23 07:51:14 gw01 systemd-journald[712]: Time spent on flushing to /var/log/journal/7171e6e09d5645bc9b6d695e81bb36a3 is 24.952ms for 778 entries.
Nov 23 07:51:14 gw01 systemd-journald[712]: System Journal (/var/log/journal/7171e6e09d5645bc9b6d695e81bb36a3) is 16M, max 200M, 184M free.
Nov 23 07:51:14 gw01 systemd-journald[712]: Received client request to flush runtime journal.

Persistence on Rocky belongs on your build checklist next to the other things to do after installing Rocky Linux 10. The missing directory gives no warning, so you usually find out at the first crash you can’t explain.

Vacuum deletes archived files only

The vacuum options never touch the active journal files. They delete the oldest archived files until the size, age or count limit holds, so on a young journal --vacuum-size often reports that it freed 0B. Rotating first archives the active files, and then vacuum can remove them:

sudo journalctl --rotate
sudo journalctl --vacuum-size=10M
journalctl --disk-usage

On Rocky that deleted the system and user archives, 2.5M in total. The remaining usage is the fresh active files, which no vacuum will shrink:

journalctl --rotate followed by --vacuum-size=10M deleting archived journal files on Rocky Linux 10

This is where the lab lost data it still needed. The rotate plus vacuum ran while the jdemo runs from a minute earlier lived only in those archives. Right after it, journalctl -u jdemo -I answered No journal entry found for the invocation (+0). and the --since window came back empty on both Ubuntu and Rocky. Before you vacuum a box you’re debugging, export what you need with journalctl -u UNIT -o export > unit.export or copy the archive files aside.

The three limits behave the same way, so choose by the question you’re answering. Which one fits depends on why you are cleaning up:

  • --vacuum-size= when the disk is filling now.
  • --vacuum-time= when a retention policy sets the limit.
  • --vacuum-files= when many small archives clutter the directory.

A one-off vacuum doesn’t stick, because journald simply grows back to its configured cap. Put the permanent limit in the drop-in from the previous section and keep vacuum for emergencies. sudo journalctl --verify printed PASS for every file on all three machines. It is worth running whenever a journal lived on a disk that filled up.

Remote journals land in their own directory

systemd can ship journals between hosts without rsyslog. systemd-journal-upload on the sender pushes entries to systemd-journal-remote on the receiver, which writes one journal file per sender and keeps every field intact. The lab used gw01 (Rocky, 10.132.0.15) as the receiver and client01 (Ubuntu, 10.132.0.14) as the sender, both on the same private network. In order:

  1. Install the package on both hosts.
  2. Switch the receiver to HTTP and open port 19532.
  3. Point the sender’s upload service at the receiver.
  4. Read the sender’s entries on the receiver.

Install the receiver first. On Rocky it is a separate package, so a minimal image won’t have it.

sudo dnf -y install systemd-journal-remote

Read the transaction before you run it on a production host. On the lab VM dnf also upgraded systemd and three of its subpackages from 257-23 to 257-33 to match the new package, so this install is really a systemd update. Schedule it like one, with the reboot window that implies.

The packaged service listens with --listen-https=-3, which needs a server certificate and key before it will accept anything. For a first test on a trusted private network, override it to plain HTTP with a drop-in:

sudo mkdir -p /etc/systemd/system/systemd-journal-remote.service.d
sudo vim /etc/systemd/system/systemd-journal-remote.service.d/http.conf

The empty ExecStart= clears the packaged command before the new one is set. Without it systemd sees two start commands for the service and refuses to load the unit:

[Service]
ExecStart=
ExecStart=/usr/lib/systemd/systemd-journal-remote --listen-http=-3 --output=/var/log/journal/remote/

Open the port in firewalld, reload systemd and start the socket. The socket starts the service on the first connection, so nothing runs until a sender shows up:

sudo firewall-cmd --permanent --add-port=19532/tcp
sudo firewall-cmd --reload
sudo systemctl daemon-reload
sudo systemctl enable --now systemd-journal-remote.socket
sudo ss -tlnp | grep 19532

systemd itself holds the socket, which is why the listener shows as pid 1. SELinux stayed enforcing and ausearch -m AVC -ts recent found no denials for this setup, so no policy change is needed on Rocky:

LISTEN 0      4096               *:19532            *:*    users:(("systemd",pid=1,fd=66))

On the Ubuntu sender, a fresh cloud image answered E: Unable to locate package systemd-journal-remote until the package lists were refreshed. Update first, then install:

sudo apt-get update
sudo apt-get -y install systemd-journal-remote

The upload service reads its target from /etc/systemd/journal-upload.conf, which Ubuntu’s package ships and Rocky’s does not. vim opens or creates it either way:

sudo vim /etc/systemd/journal-upload.conf

Set the receiver’s address and port. Use the private IP or a hostname the sender can resolve:

[Upload]
URL=http://10.132.0.15:19532

Enable the uploader and confirm it is running. The first run uploads the sender’s whole journal history, not just new entries, so on a busy host expect a burst of traffic and a large remote file. The status line is the part to read.

sudo systemctl enable --now systemd-journal-upload.service
systemctl status systemd-journal-upload --no-pager

A status of Processing input... means it is running and reading the local journal. If the URL is wrong or the port is closed, the service fails and restarts instead, and journalctl -u systemd-journal-upload on the sender is where its upload errors land, so check it before you go looking on the receiver.

● systemd-journal-upload.service - Journal Remote Upload Service
     Loaded: loaded (/usr/lib/systemd/system/systemd-journal-upload.service; enabled; preset: disabled)
     Active: active (running) since Mon 2026-11-23 07:50:15 UTC; 5s ago
 Invocation: 91004e9291604c26b5f374d9188a9656
       Docs: man:systemd-journal-upload(8)
   Main PID: 2346 (systemd-journal)
     Status: "Processing input..."

Then two test lines went into client01’s journal, one of them at err priority so the receiver has something to filter on:

systemd-cat -t jdemo -p err echo 'client01: disk /srv at 97 percent'
logger -t jdemo 'client01: shipped to gw01'

That completes the setup. HTTP sends log lines in clear text, so outside a lab network switch back to --listen-https with a certificate on the receiver and an https:// URL with the matching CA on each sender.

Prove it from the central host

The sender’s status only proves that it’s sending, not that anything arrived. So how do you know the lines landed? The proof is on gw01, in a file named after the sender’s IP under /var/log/journal/remote/, and client01’s lines readable with the same filters you use locally:

sudo ls -l /var/log/journal/remote/
sudo journalctl -D /var/log/journal/remote -t jdemo --no-pager
sudo journalctl -D /var/log/journal/remote _HOSTNAME=client01 -p err -n 3 --no-pager

Three things in the result confirm the pipeline works end to end:

  • The file is named remote-10.132.0.14.journal.
  • Both test lines carry client01’s hostname.
  • -p err keeps only the err line.

So the fields survived the trip, which is the whole point of shipping journals rather than text. A syslog relay would have flattened priority and unit into one string, and you’d be back to grepping:

Reading a forwarded client journal on the central host with journalctl -D /var/log/journal/remote

Plain journalctl -t jdemo on gw01 answered -- No entries --, because the remote files sit outside the local journal. Use -D for the remote directory alone, or -m to merge it with the local journal, which returned both client01 lines. Then add _HOSTNAME= to tell senders apart. For a longer walk through field filters on a single host, see filtering systemd logs with journalctl.

Messages journalctl prints and what they mean

Every message below came up during the lab runs. Most of them are journalctl telling you about the query rather than about the system, so read them as hints about your command first:

MessageCauseFix
-- No entries --No entry matched; also printed for a unit name that does not exist (exit 0)Check the name with journalctl -F _SYSTEMD_UNIT; check -g pattern case
No journal files were opened due to insufficient permissions.User outside systemd-journal, adm and wheelsudo usermod -aG systemd-journal USER, log in again
No journal entry found for the invocation (+0).The invocation’s entries were rotated and vacuumed awayExport with -o export before you vacuum
Failed to start transient service unit: Unit jdemo.service was already loaded or has a fragment file.A failed transient unit with that name still existssudo systemctl reset-failed jdemo
Vacuuming done, freed 0B of archived journalsEverything is still in active filessudo journalctl --rotate first
ls: cannot access '/var/log/journal'Volatile journal, logs lost on rebootStorage=persistent drop-in, restart, --flush
E: Unable to locate package systemd-journal-remotePackage lists not yet fetched on a fresh Ubuntu imagesudo apt-get update

The full option list, including the rarer modes such as --setup-keys for sealing, is in the upstream journalctl man page. Every storage key used above is described in journald.conf(5).

If you keep only three habits from this page, keep these: filter by unit and invocation before you grep, check /var/log/journal on every new Rocky box, and export before you vacuum. Everything else is a field match you can look up in the tables at the top.

Keep reading

Claude Code Cheat Sheet: Commands, Shortcuts and Flags (PDF) AI Claude Code Cheat Sheet: Commands, Shortcuts and Flags (PDF) OpenAI Codex CLI Cheat Sheet: Shortcuts, Commands, Flags (PDF) AI OpenAI Codex CLI Cheat Sheet: Shortcuts, Commands, Flags (PDF) Linux and DevOps Cheat Sheets (Free PDF Pack) Cheat Sheets Linux and DevOps Cheat Sheets (Free PDF Pack) netsh Commands Cheat Sheet: Wi-Fi, Firewall, Port Proxy (PDF) Cheat Sheets netsh Commands Cheat Sheet: Wi-Fi, Firewall, Port Proxy (PDF) VS Code Keyboard Shortcuts Cheat Sheet (Windows, Mac, Linux PDF) Cheat Sheets VS Code Keyboard Shortcuts Cheat Sheet (Windows, Mac, Linux PDF) Vim Cheat Sheet: Modes, Motions, Macros and .vimrc (Free PDF) Cheat Sheets Vim Cheat Sheet: Modes, Motions, Macros and .vimrc (Free PDF)

Leave a Comment

Press ESC to close