Project selected fields as columns
Trim JSON to needed fields then tab-format; __REALTIME_TIMESTAMP is microseconds
journalctl -u <name> --output=json --output-fields=__REALTIME_TIMESTAMP,MESSAGE,_PID | jq -r '[.__REALTIME_TIMESTAMP,._PID,.MESSAGE]|@tsv'
- tool
- journalctl12 commands
More journalctl commands
-
journalctl -D /mnt/crashed/var/log/journal -b -1 -p errRead journals from another root (rescue/forensics) without copying files in
-
journalctl --header | grep -iE 'file|state'; ls -d /var/log/journal 2>/dev/null || echo volatileIf /var/log/journal is absent, logs are volatile and lost on reboot. fix: mkdir + systemd-tmpfiles
-
journalctl -p err -b --no-pagerOnly err/crit/alert/emerg from current boot; -p takes a range too (e.g. -p warning..err)
-
journalctl _SYSTEMD_UNIT=sshd.service --since todayTrusted unit match by indexed field, unlike -u which also pulls coredumps/PAM noise
-
journalctl _PID=1 + _COMM=sshd -o short-isoA bare + is a logical OR between match groups; same-field matches within a group are OR'd too