rsyslogd seems to be forwarding messages with different priorities than they have when they are generated. I'm using this conf file:
- Code: Select all
$ModLoad immark.so # --MARK-- message capability
$ModLoad imuxsock.so # support for local system logging
$ModLoad imklog.so # kernel logging support
$ModLoad imudp.so # UDP syslog input
$UDPServerAddress 10.123.0.101
$UDPServerRun 514
*.* @10.123.0.97:514;RSYSLOG_TraditionalForwardFormat
$template test, "%timegenerated% %fromhost% %syslogtag%%msg:::drop-last-lf% (%pri-text%: %syslogfacility% %syslogpriority%)\n"
*.notice;authpriv.info;kern.debug;lpr.info;mail.crit /var/log/messages
auth.info;authpriv.info /var/log/auth.log
*.* /var/log/debug.log;test
A generic sudo command (sudo w) generates this message in /var/log/debug.log:
- Code: Select all
Jul 7 13:40:08 qa-freebsd sudo: root : TTY=ttyv1 ; PWD=/root ; USER=root ; COMMAND=/usr/bin/w (local2.notice<149>: 18 5)
However, tcpdump on the machine's egress interface shows the following going out:
- Code: Select all
13:40:08.168996 IP (tos 0x0, ttl 64, id 2912, offset 0, flags [none], proto UDP (17), length 130) qa-freebsd.53011 > test-destination.syslog: SYSLOG, length: 102
Facility mail (2), Severity debug (7)
Here's a pair of tests using the logger commands:
logger -p local2.notice 'test local2.notice'
logger -p authpriv.notice 'test authpriv.notice'
And the results (order maintained):
- Code: Select all
Syslog:
Jul 7 13:43:04 qa-freebsd root: test local2.notice (local2.notice<149>: 18 5)
Jul 7 13:43:05 qa-freebsd root: test authpriv.notice (authpriv.notice<85>: 10 5)
TCPDump:
13:43:04.822675 IP (tos 0x0, ttl 64, id 3518, offset 0, flags [none], proto UDP (17), length 83) qa-freebsd.54913 > test-destination.syslog: SYSLOG, length: 55
Facility mail (2), Severity debug (7)
13:43:05.550521 IP (tos 0x0, ttl 64, id 3522, offset 0, flags [none], proto UDP (17), length 85) qa-freebsd.54913 > test-destination.syslog: SYSLOG, length: 57
Facility user (1), Severity debug (7)
Is this something I have misconfigured, or some strangeness on the part of rsyslogd? I also find it interesting that sudo is logging with local2.notice rather than authpriv.notice (as it should be), but I don't know how to dig deeper into that.
-HKS


