<div dir="ltr"><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Apr 5, 2022 at 3:22 PM Ulrich Windl <<a href="mailto:Ulrich.Windl@rz.uni-regensburg.de">Ulrich.Windl@rz.uni-regensburg.de</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">>>> Mantas Mikulenas <<a href="mailto:grawity@gmail.com" target="_blank">grawity@gmail.com</a>> schrieb am 05.04.2022 um 11:08 in<br>
Nachricht<br>
<CAPWNY8WgSRW2ewb3Fu+_XVdo7=<a href="mailto:C1m8YobWELsF3OE62pJ6vHhA@mail.gmail.com" target="_blank">C1m8YobWELsF3OE62pJ6vHhA@mail.gmail.com</a>>:<br>
> On Tue, Apr 5, 2022 at 9:36 AM Ulrich Windl <<br>
> <a href="mailto:Ulrich.Windl@rz.uni-regensburg.de" target="_blank">Ulrich.Windl@rz.uni-regensburg.de</a>> wrote:<br>
> <br>
>> 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:<br>
>> Some kernel messages are matched, others not.<br>
>><br>
> <br>
> All entries with a MESSAGE= are matched (after doing until/since/boot-id<br>
> checks). They might still be hidden for other reasons though, e.g. messages<br>
> containing weird escape characters (or accidental binary data) will be<br>
> hidden unless you use -a.<br>
<br>
And how do I find out whether a kernel message has a MESSAGE=?<br></blockquote><div><br></div><div>Messages from kernel (kmsg) or from syslog always do, it's only userspace messages from sd_journal_send() that might not have one. (Though if it shows up in journalctl, then obviously it has a message.) Try different `-o` modes though to see what fields each log entry actually has.<br></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>
As soon as I add _MESSAGE= I get no output any more (even with MESSAGE=.*).<br></blockquote><div><br></div><div>It's MESSAGE, not _MESSAGE, and there's no regex support for this kind of match. Journalctl can't search for "all entries that contain this key" unfortunately. (Would be useful though.)<br></div><div><br></div></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr">Mantas Mikulėnas</div></div></div>