Answers for "rsyslog config conditions filtering ":programname,startswith""

0

rsyslog config conditions filtering ":programname,startswith"

# logger  -t blue -p local6.notice "Test Creating Dynamic File Names Based On Program Name"
# logger  -t test_dynfile -p local6.notice "Test Creating Dynamic File Names Based On Program Name"
Posted by: Guest on October-09-2020
0

rsyslog config conditions filtering ":programname,startswith"

# cat /etc/rsyslog.d/dynamic_file.conf
# Create dynamic file template
template (name="Dyn_File" type="string" string="/var/log/app/%programname%.log")
Posted by: Guest on October-09-2020
0

rsyslog config conditions filtering ":programname,startswith"

# grep conditions -A 9 /etc/rsyslog.d/dynamic_file.conf
# Add conditions; if match, rewrite it to /var/log/app/%programname%.log"
if $syslogfacility-text == 'local6' and $programname startswith 'test' then ?Dyn_File
& ~

if $programname == 'blue' then ?Dyn_File
& ~
# The closing & ~ are closing tags to stop processing of further rules.
Posted by: Guest on October-09-2020

Code answers related to "rsyslog config conditions filtering ":programname,startswith""

Browse Popular Code Answers by Language