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 short-iso gives timestamps you can compare across servers

Journalctl
~/tips/tip-journalctl-short-iso-utc

journalctl -o short-iso -u ssh --since today

Prints log timestamps in ISO 8601 or UTC so logs from different hosts can be compared.

The default timestamps have no year or timezone, which makes comparing two servers a guessing game.

journalctl -o short-iso -u ssh --since today
journalctl --utc -o short-precise -n 20

short-iso prints ISO 8601 timestamps with the timezone offset, and short-precise adds microseconds. --utc converts all times to UTC, so lines from servers in different zones line up. The --since and --until values are interpreted in your local zone unless you add UTC to the string. For just the message text, -o cat drops all metadata. Both formats are also easier for scripts to parse than the default.

Further reading: journalctl 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