Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 246560 - [patch] net-mail/pflogsumm cannot read app-admin/metalog's log file format
Summary: [patch] net-mail/pflogsumm cannot read app-admin/metalog's log file format
Status: RESOLVED DUPLICATE of bug 155556
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High enhancement (vote)
Assignee: Net-Mail Packages
URL: http://linuxnet.ca/postfix/pflogsumm_...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-11-12 23:50 UTC by Jeff Zepeda
Modified: 2009-01-04 18:18 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jeff Zepeda 2008-11-12 23:50:35 UTC
Metalog uses a different syntax than other logging systems (e.g. syslog-ng).  As a result, the pflogsumm.pl script cannot read the metalog files.

It turns out that David Ferguson has a one line modification to the pflogsumm.pl script which makes pflogsumm.pl able to read the metalog file and produce useful results.

The modification is available on the url above, but effectively one would change the following:

while(<>) {
    next if(defined($dateStr) && ! /^$dateStr/o);
    s/: \[ID \d+ [^\]]+\] /: /o;        # lose "[ID nnnnnn some.thing]" stuff
    my $logRmdr;
    next unless((($msgMonStr, $msgDay, $msgHr, $msgMin, $msgSec, $logRmdr) =

to:

while(<>) {
    next if(defined($dateStr) && ! /^$dateStr/o);
    s/: \[ID \d+ [^\]]+\] /: /o;        # lose "[ID nnnnnn some.thing]" stuff
    #------------------------------------------------------------------------
    # metalog hack by David B. Ferguson <david@linuxnet.ca> 08/19/2008
    # see http://linuxnet.ca/postfix/pflogsumm_metalog.html for latest
    s/\[(postfix|$syslogName)\/(.*)\] /metalog $1\/$2\[54321\]: /;
    #------------------------------------------------------------------------
    my $logRmdr;
    next unless((($msgMonStr, $msgDay, $msgHr, $msgMin, $msgSec, $logRmdr) =

The change is working very well on my server, but it would be nice if portage could detect the use of metalog and apply the modification automatically.

Reproducible: Always

Steps to Reproduce:
1. Install Postfix, metalog and pflogsumm.pl
2. Run pflogsumm.pl using any options specifying any postfix log file as the target

Actual Results:  
pflogsumm returns zero traffic

Expected Results:  
pflogsumm should have returned proper postfix statistics.
Comment 1 Allen Brooker (AllenJB) 2008-11-14 10:52:45 UTC
Appears to be a dupe of (or atleast closely related to) Bug #155556
Comment 2 Jeff Zepeda 2008-11-14 18:01:45 UTC
Somehow I didn't find Bug #155556 when I searched earlier.  It appears that the patch is substantially different, although how significant that is, I cannot tell.  I noticed that the patch was not added to portage despite being provided about 2 years ago...
Comment 3 SpanKY gentoo-dev 2009-01-04 18:18:40 UTC

*** This bug has been marked as a duplicate of bug 155556 ***