Page 1 of 1

Configure rsyslog to ingest logfile with Dynamic file name

Posted: Tue Feb 19, 2019 4:50 pm
by Sampath.Basireddy
Hello There,

Can we use "/apps/tomcat/logs/gc-`date +%m%d%Y-%H%M`.log" to input a log file which gets created daily with date and time in the file name using rsyslog to ingest to NLS?


Please suggest.

Re: Configure rsyslog to ingest logfile with Dynamic file na

Posted: Tue Feb 19, 2019 5:44 pm
by cdienger
rsyslog requires an absolute name so it doesn't appear possible. Per https://www.rsyslog.com/doc/v8-stable/c ... .html#file
The file being monitored. So far, this must be an absolute name (no macros or templates). Note that wildcards are supported at the file name level (see WildCards below for more details).
An alternative would be to script something that takes the names into account like that and use the shipper.py script to transfer it. Point your browser to https://nls_ip/nagioslogserver/configure/source/import for more info on the shipper script.