How to monitor log files that we change part of the name
Posted: Tue Jun 18, 2019 2:32 am
Hey everyone,
I have the problem of monitoring "TOMCAT" files whose name changes every day
/opt/tomcat/logs/ # ls -la
-rw-r----- 1 tomcat tomcat 7.3K Jun 14 09:38 catalina.2019-06-16.log
-rw-r----- 1 tomcat tomcat 7.3K Jun 17 10:54 catalina.2019-06-17.log
-rw-r----- 1 tomcat tomcat 7.3K Jun 18 09:13 catalina.2019-06-18.log
-rw-r----- 1 tomcat tomcat 0 Jun 14 09:38 localhost_access_log.2019-06-16.txt
-rw-r----- 1 tomcat tomcat 0 Jun 17 10:54 localhost_access_log.2019-06-17.txt
-rw-r----- 1 tomcat tomcat 0 Jun 18 09:13 localhost_access_log.2019-06-18.txt
I tried to run the following setup.
sudo bash setup-linux.sh -s nagioslogserver -p 5544 -f "/opt/tomcat/logs/localhost_access_log.*.txt" -t tomcat-access
But it only created the configuration files with the date it finds
/etc/rsyslog.d
[root@jira-server rsyslog.d]# ls -l | grep tomcat_logs_localhost
-rw-r--r-- 1 root root 801 Jun 13 12:29 90-nagioslogserver_opt_tomcat_logs_localhost_access_log.2019-06-16.txt.conf
-rw-r--r-- 1 root root 801 Jun 13 12:29 90-nagioslogserver_opt_tomcat_logs_localhost_access_log.2019-06-17.txt.conf
more 90-nagioslogserver_opt_tomcat_logs_localhost_access_log.2019-06-16.txt.conf | grep InputFileName
$InputFileName /opt/tomcat/logs/localhost_access_log.2019-06-16.txt
how can I make rsyslog understand to monitor for example ?
localhost_access_log.2019-06-16.txt
localhost_access_log.2019-06-17.txt
localhost_access_log.2019-06-18.txt
...
..
catalina.2019-06-16.log
catalina.2019-06-17.log
catalina.2019-06-18.log
...
Thanks in advance
Nick
I have the problem of monitoring "TOMCAT" files whose name changes every day
/opt/tomcat/logs/ # ls -la
-rw-r----- 1 tomcat tomcat 7.3K Jun 14 09:38 catalina.2019-06-16.log
-rw-r----- 1 tomcat tomcat 7.3K Jun 17 10:54 catalina.2019-06-17.log
-rw-r----- 1 tomcat tomcat 7.3K Jun 18 09:13 catalina.2019-06-18.log
-rw-r----- 1 tomcat tomcat 0 Jun 14 09:38 localhost_access_log.2019-06-16.txt
-rw-r----- 1 tomcat tomcat 0 Jun 17 10:54 localhost_access_log.2019-06-17.txt
-rw-r----- 1 tomcat tomcat 0 Jun 18 09:13 localhost_access_log.2019-06-18.txt
I tried to run the following setup.
sudo bash setup-linux.sh -s nagioslogserver -p 5544 -f "/opt/tomcat/logs/localhost_access_log.*.txt" -t tomcat-access
But it only created the configuration files with the date it finds
/etc/rsyslog.d
[root@jira-server rsyslog.d]# ls -l | grep tomcat_logs_localhost
-rw-r--r-- 1 root root 801 Jun 13 12:29 90-nagioslogserver_opt_tomcat_logs_localhost_access_log.2019-06-16.txt.conf
-rw-r--r-- 1 root root 801 Jun 13 12:29 90-nagioslogserver_opt_tomcat_logs_localhost_access_log.2019-06-17.txt.conf
more 90-nagioslogserver_opt_tomcat_logs_localhost_access_log.2019-06-16.txt.conf | grep InputFileName
$InputFileName /opt/tomcat/logs/localhost_access_log.2019-06-16.txt
how can I make rsyslog understand to monitor for example ?
localhost_access_log.2019-06-16.txt
localhost_access_log.2019-06-17.txt
localhost_access_log.2019-06-18.txt
...
..
catalina.2019-06-16.log
catalina.2019-06-17.log
catalina.2019-06-18.log
...
Thanks in advance
Nick