journalctl is a great tool to read and filter logs. Since it is context aware, it is much easier to use compared to just using tail on text files. It can be super helpful for example to filter output given on a specific service. But how do you combine filters with a logical OR?
Today I had the need to filter the output to kernel messages, and NetworkManager. Kernel messages is -k, and NetworkManager is -u NetworkManager in short. But the combination doesn’t reveal anything:
$ journalctl -u NetworkManager -k
-- No entries --
The reason is that the (implied) logical connection here is “AND”. Only output is shown that is both a kernel message and from NetworkManager – which doesn’t exist.
journalctl knows about the + operator to combine output – but that doesn’t help with the short options used above:
$ journalctl -u NetworkManager -k
-- No entries --
Instead, we need to use the long form, call out the systemd unit as a flag explicitly, and the transport for kernel:
$ journalctl _TRANSPORT=kernel + _SYSTEMD_UNIT=NetworkManager.service --since today
...
Dez 18 21:26:52 russel NetworkManager[1510]: <info> [1734553612.1558] dhcp4 (wlp9s0): state changed new lease, address=192.168.1.2
Dez 18 21:26:52 russel kernel: wlp9s0: Limiting TX power to 30 (30 - 0) dBm as advertised by 12:34:56:78:90:12
Of course, this can be combined with -f, --since today and other typical journalctl flags. It can even be extended by more services:
$ journalctl _TRANSPORT=kernel + _SYSTEMD_UNIT=NetworkManager.service + _SYSTEMD_UNIT=wpa_supplicant.service -f



