[Tutor] parsing sendmail logs

nibudh nibudh at gmail.com
Tue Jul 15 01:57:04 CEST 2008


On Mon, Jul 14, 2008 at 8:47 PM, Kent Johnson <kent37 at tds.net> wrote:

> Lire looks like it might be useful:
> http://www.logreport.org/lire.html
>

I have seen lire, of course it's Perl, but looking over the source would
give me some ideas. In fact from a practical point of view if it does the
job i should look into it more :-)

 -- snip

> How do i go about representing the structure of the sendmail log file to
> my
> > script. I'm imagining having to filter through the logs and building up
> some
> > kind of data structure which i can use to report from. should this just
> be
> > as simple as a dash of regex and str.split() ? or are there better tools
> > that provide a richer framework to work within?
>
> These should all be pretty straightforward to program in Python using
> standard facilities for file reading and writing, lists and
> dictionaries, and string operations. You probably don't need regular
> expressions unless you want to build a regex that will find all mail
> ids of interest.
>

I will probably want to do something like this, extract the mail ids and use
those filter the logs further.


>
> To begin with I don't think you need to be parsing the log lines into
> a structure. If you decide that is useful, you might want to look at
> the loghetti project as a starting point. It parses web server logs
> but it might be a useful model.
> http://code.google.com/p/loghetti/
>
> Kent
>

thanks for the pointer. loghetti looks interesting I've downloaded the
source and from a quick review i can imagine extending this to be sendmail
aware.

Cheers,

nibudh.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20080715/a89927e8/attachment.htm>


More information about the Tutor mailing list