brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: journalctl -o with-unit shows the full unit name in front of each line

Journalctl
~/tips/tip-journalctl-output-with-unit

journalctl -o with-unit -u 'getty@*'

Prefixes each line with the full unit name, including the instance of templated services.

Templated services such as getty@tty1 all log under the same short identifier, which hides which instance spoke.

with-unit is like short-full, but it prefixes the unit and user unit names instead of the traditional syslog identifier. For templated instances you see the argument in the name, so the instance is clear from the line.

journalctl -o with-unit -u 'getty@*'

The format needs systemd 239 or newer. For a one-off look at a single unit the default format is enough, because you already know the unit.

Further reading: journalctl(1) manual page

More Journalctl tips journalctl -k -g 'killed process' --since "2 days ago" journalctl _PID=1 -b ls -lh /var/log/journal/*/*.journal~ Storage=volatile sudo journalctl --setup-keys All Journalctl tips (81) All topics

Link