postfix-users October 2010 archive
Main Archive Page > Month Archives  > postfix-users archives
postfix-users: Logfile condenser

Logfile condenser

From: Dom Latter <postfix-list_at_nospam>
Date: Tue Oct 19 2010 - 09:41:02 GMT

Helo, as one might say.

Wading through logfiles to find a particular email has been
taking up too much of my time recently [1].

I have written a logfile condenser that takes a postfix log and
generates a single line per email, with (for example) timestamp,
ham /spam, sender, recipient, spam score, size.

Thus, for example, a 25000 line logfile (about 4MB) is condensed
into 800 lines; grepping for " ham " pulls out 200 lines of
actual delivered emails. It's reasonably fast (less than a second
to do the condensing on a modern-ish box).

I wrote my own because none of the existing logfile tools did
quite what I want. The closest seemed to be this:

The question is - is there any community interest in this tool?

As something hacked up for my own purposes it is most definitely
beta code. But if there's interest I could tidy it up and
release it.

It will probably upset the purists for two reasons: it's written
in PHP [1] because that was going to be quickest for me; and it doesn't
use regexps, but rather a lot of substr()s to get the information

If there's something better out there, please say.

[0] From the example stats - that's more than 100 lines of logfile
per "actual" email.
[1] It's still a command line tool.