[systemd-devel] journalctl: switches & more with less

Kyle Evans kvans32 at gmail.com
Fri Sep 8 20:48:08 UTC 2023


Would it be possible to use switches with the basic KEY=VALUE searches. 
For instance,

journalctl -g "state changed" _SYSTEMD_UNIT=ModemManager.service + 
UNIT=ModemManager.service _PID=1 + 
OBJECT_SYSTEMD_UNIT=ModemManager.service _UID=0 + 
COREDUMP_UNIT=ModemManager.service

removing the -g "state changed" shows when MM is crasing, but adding it 
filters all of that out.


or for instance

journalctl -b -1 -u ModemManager + COREDUMP_UNIT=ModemManager.service

This specific example seems like it should not be necessary if I read 
the manual. But something about `+ COREDUMP_UNIT=name.service _UID=0 
MESSAGE_ID=fc2e22bc6ee647b6b90729ab34a250b1` does not show coredumps. 
The MESSAGE_ID looks extraneous. At any rate, it would be nice to be 
able to add to --unit switches.

It would also be nice to be able to do something like
journalctl -u ModemManager -k -b -1

I realize that I can do
journalctl _SYSTEMD_UNIT=ModemManager.service + 
UNIT=ModemManager.service _PID=1 + 
OBJECT_SYSTEMD_UNIT=ModemManager.service _UID=0 + 
COREDUMP_UNIT=ModemManager.service + _TRANSPORT=kernel -b -1

But that is kind of long winded for something that feels like it should 
be intuitively easy.

Version at hand is systemd 252 (252.12-1~deb12u1)
+PAM +AUDIT +SELINUX +APPARMOR +IMA +SMACK +SECCOMP +GCRYPT -GNUTLS 
+OPENSSL +ACL +BLKID +CURL +ELFUTILS +FIDO2 +IDN2 -IDN +IPTC +KMOD 
+LIBCRYPTSETUP +LIBFDISK +PCRE2 -PWQUALITY +P11KIT +QRENCODE +TPM2 
+BZIP2 +LZ4 +XZ +ZLIB +ZSTD -BPF_FRAMEWORK -XKBCOMMON +UTMP +SYSVINIT 
default-hierarchy=unified



More information about the systemd-devel mailing list