0

I had this rule in previous rsyslog versions:

if $fromhost-ip == 'xxx.yyy.zzz.www' then /var/log/name_of_the_server.log
& stop

And I translate it as:

template (name="dinamico" type="string" string="/var/log/%HOSTNAME%.log")
if $inputname == 'imudp' then { action(type="omfile" dynaFile="dinamico") stop }

And works like a charm... but if I want to translate this old rule:

if $fromhost-ip == 'xxx.yyy.zzz.www' then /var/log/name_of_the_server.log
if $fromhost-ip == 'xxx.yyy.zzz.www' then @aaa.bbb.ccc.ddd:514
& stop

I can't translate it.. I've try a lot of options. This was the one I thought would work:

template (name="dinamico" type="string" string="/var/log/%HOSTNAME%.log")
if $inputname == 'imudp' then { action(type="omfile" dynaFile="dinamico") @aaa.bbb.ccc.ddd:514 stop }

But it doesn't work... How should I do it? Thanks!

0 Answers0