Mercurial > repos > other > Puppet
changeset 465:f6304a8e2adc
Try to fix last day of month HTTP LogWatch
LogWatch runs for yesterday's data. And we rotate and zip web
logs on the 1st of the month. So on the 1st, when generating the
summary for the last day of the month, we need to look at a
gzipped file, not the current or old-unzipped file.
author | IBBoard <dev@ibboard.co.uk> |
---|---|
date | Sun, 25 Feb 2024 09:56:16 +0000 |
parents | 117680ac22af |
children | 202aeef575a1 |
files | common/logwatch/logfiles_http-error.conf common/logwatch/logfiles_http.conf manifests/templates.pp |
diffstat | 3 files changed, 45 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/common/logwatch/logfiles_http-error.conf Tue Feb 20 19:28:57 2024 +0000 +++ b/common/logwatch/logfiles_http-error.conf Sun Feb 25 09:56:16 2024 +0000 @@ -4,7 +4,7 @@ # What actual file? Defaults to LogPath if not absolute path.... LogFile = apache/error_*.log -LogFile = apache/error_*.log.1 +LogFile = apache/error_*.log.1.gz # If the archives are searched, here is one or more line
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/common/logwatch/logfiles_http.conf Sun Feb 25 09:56:16 2024 +0000 @@ -0,0 +1,43 @@ +######################################################## +# Define log file group for httpd +######################################################## + +# What actual file? Defaults to LogPath if not absolute path.... +LogFile = httpd/*access_log +LogFile = apache/*access.log.1.gz +LogFile = apache/*access.log.1 +LogFile = apache/*access.log +LogFile = apache2/*access.log.1 +LogFile = apache2/*access.log +LogFile = apache2/*access_log +LogFile = apache-ssl/*access.log.1 +LogFile = apache-ssl/*access.log +LogFile = nginx/*access.log +LogFile = nginx/*access.log.1 + + +# If the archives are searched, here is one or more line +# (optionally containing wildcards) that tell where they are... +#If you use a "-" in naming add that as well -mgt +Archive = archiv/httpd/*access_log.* +Archive = httpd/*access_log.* +Archive = apache/*access.log.*.gz +Archive = apache2/*access.log.*.gz +Archive = apache2/*access_log.*.gz +Archive = apache-ssl/*access.log.*.gz +Archive = archiv/httpd/*access_log-* +Archive = httpd/*access_log-* +Archive = apache/*access.log-*.gz +Archive = apache2/*access.log-*.gz +Archive = apache2/*access_log-*.gz +Archive = apache-ssl/*access.log-*.gz +Archive = nginx/*access.log.*.gz + +# Expand the repeats (actually just removes them now) +*ExpandRepeats + + +# Keep only the lines in the proper date range... +*ApplyhttpDate + +# vi: shiftwidth=3 tabstop=3 et
--- a/manifests/templates.pp Tue Feb 20 19:28:57 2024 +0000 +++ b/manifests/templates.pp Sun Feb 25 09:56:16 2024 +0000 @@ -407,7 +407,7 @@ content => 'Detail = Med', } file { '/etc/logwatch/conf/logfiles/http.conf': - content => 'LogFile = apache/access_*.log', + source => 'puppet:///common/logwatch/logfiles_http.conf', } file { '/etc/logwatch/conf/logfiles/http-error.conf': source => 'puppet:///common/logwatch/logfiles_http-error.conf',