[rsyslog] Several Actions associated to a single filter : Mail + File

Nicolas Even nicolas.even at aznetwork.eu
Mon Sep 20 15:02:19 CEST 2010


Hello, 

I would like to have several actions associated to one filter. 
When an error is detected, I want to notify someone by mail but I also want to keep that log in a special file. 

I succeded to write the log in a file, then I succeded to send the log via ommail module. 
But I want to do both actions. 

I tried it without success. 


if $fromhost-ip == '192.168.254.29' \ 
and not ( \ 
$msg contains 'discard' \ 
or $msg contains 'discard2' \ 
)\ 
then :ommail:;MailBody -?ErrorLogFile 

I saw interesting things here : http://download.rsyslog.com/rainerscript2_rsyslog.conf 
But I did not suceed to have the wanted behaviour. 

Someone can help ? 

regards, 
Nicolas Even 



More information about the rsyslog mailing list