<div dir="ltr"><div dir="ltr">On Tue, Apr 5, 2022 at 9:36 AM Ulrich Windl <<a href="mailto:Ulrich.Windl@rz.uni-regensburg.de">Ulrich.Windl@rz.uni-regensburg.de</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi!<br>
<br>
I have two questions for "journalctl -b -g logrotate":<br>
<br>
1) I'm unsure what the exact rules for matching a "-g expression" are: Some kernel messages are matched, others not.<br></blockquote><div><br></div><div>All entries with a MESSAGE= are matched (after doing until/since/boot-id checks). They might still be hidden for other reasons though, e.g. messages containing weird escape characters (or accidental binary data) will be hidden unless you use <font face="monospace">-a</font>.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
2) When the -b restricts messages to the current boot, why is output shown like this?:<br>
# journalctl -b -g logrotate<br>
-- Logs begin at Wed 2020-11-25 11:27:53 CET, end at Tue 2022-04-05 08:01:02 CEST. --<br>
<br>
I mean the boot was definitely in 2022, so I think the message is not really helpful. Why not show the date and time when the search starts (i.e. boot time)?<br></blockquote><div><br></div><div>There's no such message in the current systemd version. See <a href="https://github.com/systemd/systemd/pull/21775">https://github.com/systemd/systemd/pull/21775</a>.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
The next thing is "-k": If I supply it, kernel messages are _not_ found:<br>
# journalctl -S 2022-04-02 -k | grep "OCFS2:" |head<br>
# journalctl -S 2022-04-02 | grep "OCFS2:" |head<br>
Apr 02 02:00:06 h18 kernel: OCFS2: ERROR (device dm-17): ocfs2_validate_gd_self: Group descriptor #209970 has bad signature EXBLK01<br>
Apr 02 02:00:06 h18 kernel: OCFS2: File system is now read-only.<br>
Apr 02 02:00:07 h18 kernel: OCFS2: ERROR (device dm-17): ocfs2_validate_gd_self: Group descriptor #209817 has bad signature EXBLK01<br>
Apr 02 02:00:07 h18 kernel: OCFS2: ERROR (device dm-17): ocfs2_validate_gd_self: Group descriptor #209946 has bad signature EXBLK01<br>
<br>
So can I find kernel messages from previous boots?<br></blockquote><div><br></div><div>`journalctl -k` is meant to imitate dmesg (except with correct timestamps), so it shows the current boot only. You can use <font face="monospace">_TRANSPORT=kernel</font> to filter for kernel messages if you don't want that.</div><div><br></div><div><font face="monospace">$ journalctl _TRANSPORT=kernel -g BogoMIPS</font></div></div><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr">Mantas Mikulėnas</div></div></div>