Moderator: rgerhards
if $msg contains 'Alerts:' and ($fromhost-ip == 'x.y.z.1' or $fromhost-ip == 'x.y.z.2' or $fromhost-ip == 'x.y.z.3') then /var/log/Alerts_Logsif $msg contains 'Alerts:' then /var/log/Alerts/logs
if $fromhost-ip == 'x.y.z.2' then /var/log/x.y.z.2/logs:fromhost-ip, isequal, "x.y.z.1"
*.* /var/log/x.y.z.1/logsthe last error occured in /etc/rsyslog.conf, line 81
warning: selector line without actions will be discarded
4515.921959000:main thread: Action 0x9cad3c8: queue 0x9cad460 created
4515.921985000:main thread: cfline: ':fromhost-ip, isequal, "x.y.z.1"'
4515.921995000:main thread: selector line successfully processed
4515.922005000:main thread: - property-based filter
4515.922021000:main thread: tried selector action for builtin-file: -2001
4515.922032000:main thread: tried selector action for builtin-fwd: -2001
4515.922042000:main thread: tried selector action for builtin-shell: -2001
4515.922053000:main thread: tried selector action for builtin-discard: -2001
4515.922080000:main thread: tried selector action for builtin-usrmsg: -2001
4515.922091000:main thread: config line NOT successfully processed
4515.922103000:main thread: Called LogError, msg: the last error occured in /etc/rsyslog.conf, line 81
4515.922203000:main thread: cfline: '*.* /var/log/x.y.z.1/logs'
4515.922215000:main thread: Called LogError, msg: warning: selector line without actions will be discarded
Thorgull wrote:
- Code: Select all
:fromhost-ip, isequal, "x.y.z.1"
*.* /var/log/x.y.z.1/logs
:fromhost-ip, isequal, "x.y.z.1" /var/log/x.y.z.1/logs
$template test, "TIME GEN: %timegenerated:::date-rfc3339% HOSTNAME: %hostname% FROMHOST: %fromhost% FROMIP: %fromhost-ip% FACILITY: %syslogfacility% PRIORITY: %syslogpriority% TAG: %syslogtag% MSG: %msg%\n"
*.* /var/log/test.log;test
hkspvt wrote:The first line there is a selector without an action. I think what you really want is:
- Code: Select all
:fromhost-ip, isequal, "x.y.z.1" /var/log/x.y.z.1/logs
hkspvt wrote:
- Code: Select all
$template test, "TIME GEN: %timegenerated:::date-rfc3339% HOSTNAME: %hostname% FROMHOST: %fromhost% FROMIP: %fromhost-ip% FACILITY: %syslogfacility% PRIORITY: %syslogpriority% TAG: %syslogtag% MSG: %msg%\n"
*.* /var/log/test.log;test





Users browsing this forum: psbot [Picsearch] and 0 guests