0

How do I convert the following to rsyslog syntax?

filter local2 { facility(local2); }; 
filter not_local2 { not facility(local2); }; 

destination server2  { tcp("server2" port(1111)); };
destination localhost { file ("/var/log/local2.log"); };

log { source(s_all); filter(local2); destination(localhost); };

filter pics { program ("preview_*"); };
destination pics  { file ("/logdir/${PROGRAM}.log"); };
log { source(s_all); filter(pics); destination(pics); };
1

Did you find it ? If not, propably it's something like ...

if (%facility% equals local2 ) then /var/log/local2.log

if (%programname% equals 'preview_*' ) then /logdir/%programname%.log

(You didn't use server2 anywhere, so i didn't include it)

(Much easier ;p)

Hope it helps.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.