My question is regarding creating a logsource for logs with custom names that change over time. For example, new Apache httpd access and error log files are creating every hour and the file names contain the timestamp. I thought passing a wildcard in the logsource would handle the scenario, but logs cease to be collected once the hour has passed:
e.g.
Apache httpd accesslogs
creating a log source:
Code: Select all
sudo bash setup-linux.sh -s (NLS fqdn) -p 5544 -f /srv/sandboxes/sb10/logs/*access_log -t apache_access
Your system $PATH does not include /sbin and /usr/sbin. This could be the result of installing GNOME rather than creating a clean system.
Adding /sbin and /usr/sbin to $PATH.
Detected rsyslog 5.8.12
Detected rsyslog work directory /var/lib/rsyslog
Destination Log Server: (NLS fqdn):5544
Creating /etc/rsyslog.d/90-nagioslogserver_srv_sandboxes_sb10_logs_web21-sb10-20150316-1300-access_log.conf...
SELinux is disabled.
rsyslog configuration check passed.
Restarting rsyslog service with 'service'...
Shutting down system logger: [ OK ]
Starting system logger: [ OK ]
Okay.
rsyslog is running with the new configuration.
Visit your Nagios Log Server dashboard to verify that logs are being received.Code: Select all
cat 90-nagioslogserver_srv_sandboxes_sb10_logs_web21-sb10-20150316-1300-access_log.conf
$ModLoad imfile
$InputFilePollInterval 10
$PrivDropToGroup adm
$WorkDirectory /var/lib/rsyslog
# Input for apache_access
$InputFileName /srv/sandboxes/sb10/logs/web21-sb10-20150316-1300-access_log
$InputFileTag apache_access:
$InputFileStateFile nls-state-srv_sandboxes_sb10_logs_web21-sb10-20150316-1300-access_log # Must be unique for each file being polled
# Uncomment the folowing line to override the default severity for messages
# from this file.
#$InputFileSeverity info
$InputFilePersistStateInterval 20000
$InputRunFileMonitor
# Forward to Nagios Log Server and then discard, otherwise these messages
# will end up in the syslog file (/var/log/messages) unless there are other
# overriding rules.
if $programname == 'apache_access' then @@(NLS fqdn):5544
if $programname == 'apache_access' then ~Any help would be appreciated. I would be happy to provide more information if necessary.
Thanks.