[systemd-devel] Can one filter specific kernel messages from being logged?

Alban Browaeys alban.browaeys at gmail.com
Sat May 27 16:32:50 UTC 2023


Can I filter out specific messages from the kernel from being sent to
journald?

It seems to me LogFilterPatterns= is for units only.


On
github https://github.com/systemd/systemd/issues/6432#issuecomment-1509879880
r7l needs to filter kernel ACPI messages :
Apr 15 17:42:30 platzhirsch kernel: ACPI BIOS Error (bug): Failure
creating named object [\_SB.PC00.PEG1.PEGP._DSM.USRG],
AE_ALREADY_EXISTS (20221020/dsfield-184)
Apr 15 17:42:30 platzhirsch kernel: ACPI Error: AE_ALREADY_EXISTS,
CreateBufferField failure (20221020/dswload2-477)


I myself also would like to filter kernel messages:
{"_BOOT_ID":"632f8deb819945c48e0e8feba5d2b14e","PRIORITY":"7","_RUNTIME
_SCOPE":"system","_SOURCE_MONOTONIC_TIMESTAMP":"520901025245","__MONOTO
NIC_TIMESTAMP":"520916614118","__CURSOR":"s=fa767d4f52854c7185d98f29556
0b05b;i=1386dce;b=632f8deb819945c48e0e8feba5d2b14e;m=79490cbbe6;t=5fcae
6a0d7139;x=d93093105a24ab81","SYSLOG_FACILITY":"0","_UDEV_SYSNAME":"fe3
20000.mmc","_KERNEL_DEVICE":"+platform:fe320000.mmc","_HOSTNAME":"helio
s64","__REALTIME_TIMESTAMP":"1685200917328185","_MACHINE_ID":"4d4f6d7f9
df948e6afd380c743b4ba53","SYSLOG_IDENTIFIER":"kernel","_TRANSPORT":"ker
nel","_KERNEL_SUBSYSTEM":"platform","MESSAGE":"dwmmc_rockchip
fe320000.mmc: pm_clk_suspend()"}





Note: As is shown in the https://github.com/systemd/systemd/issues/6432
issue, a lot of myths are common (like systemd forcing applications to
output their daemon logs to journald, when in fact there is
StandardOutput and StandardError and it was userspace daemon choice to
switch from /var/log/<daemon_name>.log file to journald, or maybe
ignorance).
Maybe a discourse server would be a place were one can answer the
people that think systemd force things on them (when in fact it is the
userspace daemons choosing to setup this way with systemd). Though that
might diverge too many resources from development.
And it could be a lost cause either way. Hard to tell.


More information about the systemd-devel mailing list