theravadamonk has asked for the wisdom of the Perl Monks concerning the following question:
Hi monks, I have a postfix logfile /var/log/maillog. I want to send a blocked mail digest to users on daily basis. ( Let's say @ 10.30 am everyday). I want to print all lines from 10.30 a.m from yesterday to 10.30 am today from this /var/log/maillog to anoter file.
Then I will grep the BLOCKED mails from this file and send a Blocked mail Digest report to users.
How can I achieve this?
I found similar urls.
Extracting Log File data for a given date range
http://stackoverflow.com/questions/21995141/perl-script-to-extract-data-from-log-file-between-two-date-ranges-not-necessary
mail maillog looks like this
and so on I am still trying to write it. Can you monks help me on this.Feb 1 03:10:39 mailgw postfix/smtpd[31168]: disconnect from host.doma +in.net[8.3.14.x] Feb 1 03:10:41 mailgw postfix/smtpd[31175]: connect from localhost.lo +caldomain[127.0.0.1] Feb 1 03:10:41 mailgw postfix/smtpd[31175]: 42B1A1620467: client=loca +lhost.localdomain[127.0.0.1]
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: print lines withing specific date range from maillog file
by Corion (Patriarch) on Mar 17, 2016 at 09:17 UTC | |
by theravadamonk (Scribe) on Mar 17, 2016 at 10:56 UTC | |
by Corion (Patriarch) on Mar 17, 2016 at 12:03 UTC | |
by theravadamonk (Scribe) on Mar 28, 2016 at 11:30 UTC | |
by Corion (Patriarch) on Mar 28, 2016 at 11:45 UTC | |
|