Bug 140429

Summary: logwatch doesn't process yum logs correctly
Product: [Fedora] Fedora Reporter: Theodore C. Belding <ted.belding>
Component: logwatchAssignee: Ivana Varekova <varekova>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 3CC: brian, gedetil, grdetil, holger, mattdm, paul, sitsofe
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2005-06-23 11:54:36 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
/var/log/yum.log
none
/etc/log.d/scripts/shared/applyyumdate: logwatch date filter for yum logs
none
patch to /etc/log.d/scripts/services/yum
none
patch to /etc/log.d/conf/logfiles/yum.conf
none
/etc/log.d/scripts/logfiles/yum/applydate script none

Description Theodore C. Belding 2004-11-22 21:21:48 UTC
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.

Comment 1 Theodore C. Belding 2004-11-22 21:22:21 UTC
Created attachment 107244 [details]
/var/log/yum.log

Comment 2 Holger Eilhard 2004-11-23 14:39:10 UTC
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. :)

Comment 3 Holger Eilhard 2004-11-23 14:52:47 UTC
Ok, the above doesn't really solve it, as it always shows anything
that's in your yum.log...

Comment 4 Theodore C. Belding 2004-11-23 20:49:14 UTC
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).



Comment 5 Theodore C. Belding 2004-11-23 21:29:39 UTC
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.


Comment 6 Theodore C. Belding 2004-11-23 21:31:00 UTC
Created attachment 107340 [details]
/etc/log.d/scripts/shared/applyyumdate: logwatch date filter for yum logs

logwatch date filter for yum logs

Comment 7 Theodore C. Belding 2004-11-23 21:33:18 UTC
Created attachment 107342 [details]
patch to /etc/log.d/scripts/services/yum

Comment 8 Theodore C. Belding 2004-11-23 21:33:56 UTC
Created attachment 107343 [details]
patch to /etc/log.d/conf/logfiles/yum.conf

Comment 9 Gilles Detillieux 2004-12-03 17:48:08 UTC
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.

Comment 10 Theodore C. Belding 2004-12-24 01:56:19 UTC
The above changes seem to work fine for me. Thanks!


Comment 11 Sitsofe Wheeler 2005-01-28 21:49:41 UTC
The change mentioned in this bug work a charm for me too - can this change be
pushed out in an update?

Comment 12 Paul Howarth 2005-04-06 09:10:31 UTC
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.

Comment 13 Paul Howarth 2005-05-26 12:39:43 UTC
This issue is fixed in upstream versions >= 6


Comment 14 Ivana Varekova 2005-06-23 11:54:36 UTC
Fixed version in fc4.