I've a little problem with regular epxression in Rsyslog 17.2.
In fact I just want to forward the message when the Hostname starts with 'z' or 'x' or ( htmn but not contains 'rsip).
So after some I've writed the following line without syntax error:
- Code: Select all
if $HOSTNAME startswith 'x' or $HOSTNAME startswith 'z' or ($HOSTNAME startswith 'htmn' and not ($HOSTNAME contains 'rsip')) then @@192.168.107.21:4391;DBRecFmt
My problem is that the forwarding only occur for the last statatement " ($HOSTNAME startswith 'htmn' and not ($HOSTNAME contains 'rsip') ". All message where HOSTNAME starts with 'x' or 'z' are not forwarded.
Anybody can help me?
Best regards,
Vince

