saz / puppet-rsyslog

Manage rsyslog through puppet
Apache License 2.0
50 stars 203 forks source link

How does ' if scope.lookupvar ' ? #277

Closed Tomelin closed 7 years ago

Tomelin commented 7 years ago

Hi Dear,

I have configuration the rsyslog module with parameter 'if', but not function.

How to create rule this exemple: $template tplremote3,"%timegenerated% %HOSTNAME% %fromhost-ip% %syslogtag%%msg:::drop-last-lf%\n" $template RemoteHost3,"/var/log/%HOSTNAME%-secure.log" if $syslogfacility-text == 'authpriv' then ?RemoteHost3;tplremote3 & ~ $template tplremote4,"%timegenerated% %HOSTNAME% %fromhost-ip% %syslogtag%%msg:::drop-last-lf%\n" $template RemoteHost4,"/var/log/%HOSTNAME%-audit.log" if $syslogfacility-text == 'local2' then ?RemoteHost4;tplremote4

Thanks!

Tomelin commented 7 years ago

Hi,

That it. log_filters => [{ 'expression' => "programname == 'foo'", 'action' => '/var/log/teste' } ],

thanks