dmesg等と同じようにLinuxの起動時間でのタイムスタンプで表示したかったので方法をメモ
検証環境は VirtualBox 上の Ubuntu16.04 です。
実行方法
結論としては、出力フォーマットに short-monotonic
を指定すればよいです。
タイムスタンプを起動からの経過時間で表示
$ journalctl -o short-monotonic
or
$ journalctl --output=short-monotonic
実行例
実行例
$ journalctl --output=short-monotonic | tail
[ 146.085046] koara-VirtualBox systemd[1080]: Stopped target Default.
[ 146.085226] koara-VirtualBox systemd[1080]: Reached target Shutdown.
[ 146.085373] koara-VirtualBox systemd[1080]: Starting Exit the Session...
[ 146.085644] koara-VirtualBox systemd[1080]: Stopped target Basic System.
[ 146.085778] koara-VirtualBox systemd[1080]: Stopped target Paths.
[ 146.085921] koara-VirtualBox systemd[1080]: Stopped target Sockets.
[ 146.086052] koara-VirtualBox systemd[1080]: Stopped target Timers.
[ 146.095780] koara-VirtualBox systemd[1080]: Received SIGRTMIN+24 from PID 2264 (kill).
[ 146.098459] koara-VirtualBox systemd[1]: Stopped User Manager for UID 108.
[ 146.099075] koara-VirtualBox systemd[1]: Removed slice User Slice of lightdm.
参考
systemd のログを確認する journalctl – 愛しく切ない1bed
systemd - ArchWiki
man journalctl の訳 - kandamotohiro