rsyslog with filenames
Posted: Tue Mar 26, 2019 2:37 pm
So, this is my config file for rsyslog for the files I am sending to Nagios Log Sevrer:
I want to add a field to data adding the filename which is available via metadata for imfile in rsyslog. I've been reading for days on trying to do it and just can not wrap my head around it, especially since my config files look completely different than the sames I am seeing online.
Has anyone used rsyslog with wildcards and modified the data to include a filename field?
Code: Select all
$ModLoad imfile
$MaxOpenFiles 11000
$InputFilePollInterval 10
$WorkDirectory /var/imfilestate
# Input for FILE_PATH
$InputFileName /ofsh_prod/hdfs/ofsllprd/logs/*.log
$InputFileTag RDN
$InputFileStateFile nls-state-RDN # Must be unique for each file being polled
$InputFilePersistStateInterval 20000
$InputRunFileMonitor
# Forward to Nagios Logserver and then discard.
if $programname == 'RDN' then @@xxxxxxxx.com:5544
if $programname == 'RDN' then ~
Has anyone used rsyslog with wildcards and modified the data to include a filename field?