Re: Extracting delivery attempts from log files

2016-08-22 Thread Nicolas HAHN

There also this project:

https://sourceforge.net/p/x-itools/wiki/Home/


Le 22/08/2016 à 03:42, Steve Atkins a écrit :

On Aug 21, 2016, at 5:13 AM, Wietse Venema  wrote:

Robert Schetterer:

Am 21.08.2016 um 05:10 schrieb Steve Atkins:

I find I need to extract a list of deliveries, and delivery attempts, from 
postfix logs. Ideally I'd like to feed /var/log/mail.log into some script and 
get out something like {timestamp, peer ip, helo, envelope from, recipient, 
message-id} for every email.

Does anyone know of a log analyzer or some other script that'll do that?

Cheers,
  Steve


http://linux.die.net/man/1/pflogsumm
https://github.com/benningm/saftpresse
https://sourceforge.net/projects/logwatch/

All good analyzers - I've been using pflogsumm for years - but they
do too much analyzing and summarizing for what I need today.


There also is auxiliary/collate/collate.pl in the Postfix 3.2
source-code distribution.

"This script, by Viktor Dukhovni, untangles a Postfix logfile and
groups the records one "session" at a time based on queue ID and
process ID information. Records from different sessions are separated
by an empty line.  Such text is easy to process with $/="" in perl,
or RS="" in awk."

With the logging organized by email "session", all you need
is a script that picks out the desired fields.

Nice. That'll make it easier to pull out the deliveries. (And the rejected
delivery attempts are just a single line in the original logs, so easy
enough to handle separately).

Thanks.

Cheers,
   Steve



<>

Re: Extracting delivery attempts from log files

2016-08-21 Thread Steve Atkins

> On Aug 21, 2016, at 5:13 AM, Wietse Venema  wrote:
> 
> Robert Schetterer:
>> Am 21.08.2016 um 05:10 schrieb Steve Atkins:
>>> I find I need to extract a list of deliveries, and delivery attempts, from 
>>> postfix logs. Ideally I'd like to feed /var/log/mail.log into some script 
>>> and get out something like {timestamp, peer ip, helo, envelope from, 
>>> recipient, message-id} for every email.
>>> 
>>> Does anyone know of a log analyzer or some other script that'll do that?
>>> 
>>> Cheers,
>>>  Steve
>>> 
>> 
>> http://linux.die.net/man/1/pflogsumm
>> https://github.com/benningm/saftpresse
>> https://sourceforge.net/projects/logwatch/

All good analyzers - I've been using pflogsumm for years - but they
do too much analyzing and summarizing for what I need today.

> 
> There also is auxiliary/collate/collate.pl in the Postfix 3.2
> source-code distribution.
> 
>"This script, by Viktor Dukhovni, untangles a Postfix logfile and
>groups the records one "session" at a time based on queue ID and
>process ID information. Records from different sessions are separated
>by an empty line.  Such text is easy to process with $/="" in perl,
>or RS="" in awk."
> 
> With the logging organized by email "session", all you need 
> is a script that picks out the desired fields.

Nice. That'll make it easier to pull out the deliveries. (And the rejected
delivery attempts are just a single line in the original logs, so easy
enough to handle separately).

Thanks.

Cheers,
  Steve

Re: Extracting delivery attempts from log files

2016-08-21 Thread Robert Schetterer
Am 21.08.2016 um 14:13 schrieb Wietse Venema:
> Robert Schetterer:
>> Am 21.08.2016 um 05:10 schrieb Steve Atkins:
>>> I find I need to extract a list of deliveries, and delivery attempts, from 
>>> postfix logs. Ideally I'd like to feed /var/log/mail.log into some script 
>>> and get out something like {timestamp, peer ip, helo, envelope from, 
>>> recipient, message-id} for every email.
>>>
>>> Does anyone know of a log analyzer or some other script that'll do that?
>>>
>>> Cheers,
>>>   Steve
>>>
>>
>> http://linux.die.net/man/1/pflogsumm
>> https://github.com/benningm/saftpresse
>> https://sourceforge.net/projects/logwatch/
> 
> There also is auxiliary/collate/collate.pl in the Postfix 3.2
> source-code distribution.
> 
> "This script, by Viktor Dukhovni, untangles a Postfix logfile and
> groups the records one "session" at a time based on queue ID and
> process ID information. Records from different sessions are separated
> by an empty line.  Such text is easy to process with $/="" in perl,
> or RS="" in awk."
> 
> With the logging organized by email "session", all you need 
> is a script that picks out the desired fields.
> 
>   Wietse
> 

that sounds great


Best Regards
MfG Robert Schetterer

-- 
[*] sys4 AG

http://sys4.de, +49 (89) 30 90 46 64
Schleißheimer Straße 26/MG, 80333 München

Sitz der Gesellschaft: München, Amtsgericht München: HRB 199263
Vorstand: Patrick Ben Koetter, Marc Schiffbauer
Aufsichtsratsvorsitzender: Florian Kirstein


Re: Extracting delivery attempts from log files

2016-08-21 Thread Wietse Venema
Robert Schetterer:
> Am 21.08.2016 um 05:10 schrieb Steve Atkins:
> > I find I need to extract a list of deliveries, and delivery attempts, from 
> > postfix logs. Ideally I'd like to feed /var/log/mail.log into some script 
> > and get out something like {timestamp, peer ip, helo, envelope from, 
> > recipient, message-id} for every email.
> > 
> > Does anyone know of a log analyzer or some other script that'll do that?
> > 
> > Cheers,
> >   Steve
> > 
> 
> http://linux.die.net/man/1/pflogsumm
> https://github.com/benningm/saftpresse
> https://sourceforge.net/projects/logwatch/

There also is auxiliary/collate/collate.pl in the Postfix 3.2
source-code distribution.

"This script, by Viktor Dukhovni, untangles a Postfix logfile and
groups the records one "session" at a time based on queue ID and
process ID information. Records from different sessions are separated
by an empty line.  Such text is easy to process with $/="" in perl,
or RS="" in awk."

With the logging organized by email "session", all you need 
is a script that picks out the desired fields.

Wietse


Re: Extracting delivery attempts from log files

2016-08-21 Thread Robert Schetterer
Am 21.08.2016 um 05:10 schrieb Steve Atkins:
> I find I need to extract a list of deliveries, and delivery attempts, from 
> postfix logs. Ideally I'd like to feed /var/log/mail.log into some script and 
> get out something like {timestamp, peer ip, helo, envelope from, recipient, 
> message-id} for every email.
> 
> Does anyone know of a log analyzer or some other script that'll do that?
> 
> Cheers,
>   Steve
> 

http://linux.die.net/man/1/pflogsumm
https://github.com/benningm/saftpresse
https://sourceforge.net/projects/logwatch/


Best Regards
MfG Robert Schetterer

-- 
[*] sys4 AG

http://sys4.de, +49 (89) 30 90 46 64
Schleißheimer Straße 26/MG, 80333 München

Sitz der Gesellschaft: München, Amtsgericht München: HRB 199263
Vorstand: Patrick Ben Koetter, Marc Schiffbauer
Aufsichtsratsvorsitzender: Florian Kirstein


Extracting delivery attempts from log files

2016-08-20 Thread Steve Atkins
I find I need to extract a list of deliveries, and delivery attempts, from 
postfix logs. Ideally I'd like to feed /var/log/mail.log into some script and 
get out something like {timestamp, peer ip, helo, envelope from, recipient, 
message-id} for every email.

Does anyone know of a log analyzer or some other script that'll do that?

Cheers,
  Steve