Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 246560

Summary: [patch] net-mail/pflogsumm cannot read app-admin/metalog's log file format
Product: Gentoo Linux Reporter: Jeff Zepeda <zteccc>
Component: Current packagesAssignee: Net-Mail Packages <net-mail+disabled>
Status: RESOLVED DUPLICATE    
Severity: enhancement CC: gentoo-bugs
Priority: High    
Version: unspecified   
Hardware: All   
OS: Linux   
URL: http://linuxnet.ca/postfix/pflogsumm_metalog.html
Whiteboard:
Package list:
Runtime testing required: ---

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 ***