Bug 140429 - logwatch doesn't process yum logs correctly
logwatch doesn't process yum logs correctly
Status: CLOSED CURRENTRELEASE
Product: Fedora
Classification: Fedora
Component: logwatch (Show other bugs)
3
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Ivana Varekova
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2004-11-22 16:21 EST by Theodore C. Belding
Modified: 2007-11-30 17:10 EST (History)
7 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2005-06-23 07:54:36 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
/var/log/yum.log (4.07 KB, text/plain)
2004-11-22 16:22 EST, Theodore C. Belding
no flags Details
/etc/log.d/scripts/shared/applyyumdate: logwatch date filter for yum logs (1.20 KB, text/plain)
2004-11-23 16:31 EST, Theodore C. Belding
no flags Details
patch to /etc/log.d/scripts/services/yum (366 bytes, text/plain)
2004-11-23 16:33 EST, Theodore C. Belding
no flags Details
patch to /etc/log.d/conf/logfiles/yum.conf (288 bytes, text/plain)
2004-11-23 16:33 EST, Theodore C. Belding
no flags Details
/etc/log.d/scripts/logfiles/yum/applydate script (1.39 KB, text/plain)
2004-12-03 12:48 EST, Gilles Detillieux
no flags Details

  None (edit)
Description Theodore C. Belding 2004-11-22 16:21:48 EST
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 16:22:21 EST
Created attachment 107244 [details]
/var/log/yum.log
Comment 2 Holger Eilhard 2004-11-23 09:39:10 EST
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 09:52:47 EST
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 15:49:14 EST
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 16:29:39 EST
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 16:31:00 EST
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 16:33:18 EST
Created attachment 107342 [details]
patch to /etc/log.d/scripts/services/yum
Comment 8 Theodore C. Belding 2004-11-23 16:33:56 EST
Created attachment 107343 [details]
patch to /etc/log.d/conf/logfiles/yum.conf
Comment 9 Gilles Detillieux 2004-12-03 12:48:08 EST
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-23 20:56:19 EST
The above changes seem to work fine for me. Thanks!
Comment 11 Sitsofe Wheeler 2005-01-28 16:49:41 EST
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 05:10:31 EDT
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 08:39:43 EDT
This issue is fixed in upstream versions >= 6
Comment 14 Ivana Varekova 2005-06-23 07:54:36 EDT
Fixed version in fc4. 

Note You need to log in before you can comment on or make changes to this bug.