From Bugzilla Helper: User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.5) Gecko/20041111 Firefox/1.0 Description of problem: logwatch produces no output after processing /var/log/yum.log, even though the log contains entries from the relevant time range. Version-Release number of selected component (if applicable): logwatch-5.2.2-1 How reproducible: Always Steps to Reproduce: 1. Run "logwatch --service yum --range All --detail high --print" as root. 2. 3. Actual Results: No output. Expected Results: logwatch should print a list of the packages installed or updated by yum during the period covered by the log file. Additional info: I've attached my /var/log/yum.log file for reference. I'm using yum-2.1.11-3.
Created attachment 107244 [details] /var/log/yum.log
Removing the line: *ApplyUSDate from /etc/log.d/conf/logfiles/yum.conf solves the problem. Though, I haven't yet found out what it does or tries to do. :)
Ok, the above doesn't really solve it, as it always shows anything that's in your yum.log...
The problem does seem to be with the *ApplyUSDate script; *ApplyStdDate doesn't work either. I modified /etc/log.d/scripts/services/yum to print out each line that it received from stdin, and if either *ApplyUSDate or *ApplyStdDate are used in /etc/log.d/conf/logfiles/yum.conf, /etc/log.d/scripts/services/yum gets no input. If neither script is used, /etc/log.d/scripts/services/yum gets the entire log file as input. I'm not sure why *ApplyStdDate doesn't work, since the dates seem to be in the same format as /var/log/messages (but without the host name).
Okay, I've found and fixed the problems. yum logs are not in US date format but in syslog format without a host name. I modified ApplyStdDate to produce a script ApplyYumDate and modified /etc/log.d/conf/logfiles/yum.conf to use it. I also patched /etc/log.d/scripts/services/yum to remove dates in the syslog format "Nov 09 23:56:36". I'm attaching both applyyumdate and the patches.
Created attachment 107340 [details] /etc/log.d/scripts/shared/applyyumdate: logwatch date filter for yum logs logwatch date filter for yum logs
Created attachment 107342 [details] patch to /etc/log.d/scripts/services/yum
Created attachment 107343 [details] patch to /etc/log.d/conf/logfiles/yum.conf
Created attachment 107849 [details] /etc/log.d/scripts/logfiles/yum/applydate script The applyyumdate script above will fail on single digit dates, as yum 2.1's log file has a leading zero on these, and applyyumdate assumes a leading space. Also, the standard way of adding a custom applydate script for a specific logfile format is to put it in a directory for that log file name under the /etc/log.d/scripts/logfiles directory, rather than in shared scripts. I've set up my /etc/log.d/scripts/logfiles/yum/applydate script for yum to handle both the old (pre-2.1) and new date formats. No change is needed to the /etc/log.d/scripts/services/yum, but the "*ApplyUSDate" line in /etc/log.d/conf/logfiles/yum.conf should be removed entirely.
The above changes seem to work fine for me. Thanks!
The change mentioned in this bug work a charm for me too - can this change be pushed out in an update?
I've put together a package based on the latest development SRPM and included Gilles Detillieux's changes mentioned in comment #9. Works fine for me (in older versions of Fedora too). It's available at: http://www.city-fan.org/ftp/contrib/sysutils/ I'll maintain a logwatch package there until such time as an official update comes out that fixes this problem.
This issue is fixed in upstream versions >= 6
Fixed version in fc4.