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 cat prints only the message text

Journalctl
~/tips/tip-journalctl-output-cat-message-only

journalctl -u myapp -o cat

Prints just the message text of each entry, without time stamps or host names.

Time stamps and host names are great until I want to copy the message or feed it to another tool.

-o cat prints the message of each entry and nothing else, no date, no host, no identifier. It is the cleanest format for grep, sort and uniq -c, which makes it good for counting how often a message repeats.

journalctl -u myapp -o cat

Without a time stamp the order is all you have, so keep another format around when timing matters.

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