I configure the rsyslog server with /var/rsyslog/foo.conf to accept the udp messages
$ModLoad imudp $UDPServerRun 514 And try to filter the log contents start with "foo" to /var/log/foo.log. I have tried several filters.
:msg, contains, "foo" /var/log/foo.log :msg, startswith, "foo" /var/log/foo.log :msg, regex, "'^\s*foo.*" /var/log/foo.log if $msg startswith 'foo' then /var/log/foo.log; Nothing is working. I can get the proper in /vag/log/syslog but no way to filter it and output to foo.log. the message I got from syslog like this:
 2023-12-02T17:06:20.852836+00:00 foo Which proves the udp and general logging are good. But no idea why the filters are not working.
my rsyslog server version is 8.2302.0 and the OS is Debian 12.
syslog? Was/var/log/foo.logautomatically created after the restart?