# HG changeset patch # User IBBoard # Date 1708854976 0 # Node ID f6304a8e2adc06658aae33851ecb1652f302b01f # Parent 117680ac22afa621194823328e4548b93f666695 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. diff -r 117680ac22af -r f6304a8e2adc common/logwatch/logfiles_http-error.conf --- 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 diff -r 117680ac22af -r f6304a8e2adc common/logwatch/logfiles_http.conf --- /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 diff -r 117680ac22af -r f6304a8e2adc manifests/templates.pp --- 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',