I have to write a script either in perl or python. Im having trouble parsing a maillog file. These are the given requirements:
Takes a logfile as a command line argument and prints to a file named hourlyInfo which is not a command line argument the number of postfix rejects every minute and the numbers of amavis quarantines every minute.
Example output should contain one line per minute, so you will have 60 lines (because the logfile we supplied only covers an hour) that have the following format.
Mar 1 hh:mm [postfix rejects:27] [amavis quarantines:30]
Mar 1 hh:mm [postfix rejects:17] [amavis quarantines:33]
*Note the maillog file looks like this:
Mar 1 00:02:05 avas postfix/smtpd: connect from unknown[220.127.116.11]
Mar 1 00:02:05 avas postfix/smtpd: connect from out.mms.shockwave.com[18.104.22.168]
Mar 1 00:02:05 avas postfix/smtpd: 6D9C461A83: client=out.mms.shockwave.com[22.214.171.124]
Mar 1 00:02:05 avas postfix/smtpd: disconnect from unknown[126.96.36.199]
Mar 1 00:02:28 avas amavis: (02166-05) Passed, -> , Message-ID: , Hits: 0.271