Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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); };
share|improve this question

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.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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