Checking postfix mail log with AWK

Hello,

Few days ago I found a person checking his mail log by AWK. But unfortunately I forget to take the command from him. Today I got to need that command badly. Here is a reference.

When I check from my mail log like this it will not show me the details.

grep "from=<noreply@panix.com>" /var/log/mail.log
Jun 28 08:10:31 mx1 postfix/qmgr[29326]: B98E03262CE: from=<noreply@panix.com>, size=50076, nrcpt=1 (queue active)
Jun 28 09:40:31 mx1 postfix/qmgr[29326]: B98E03262CE: from=<noreply@panix.com>, size=50076, nrcpt=1 (queue active)
Jun 28 11:10:31 mx1 postfix/qmgr[29326]: B98E03262CE: from=<noreply@panix.com>, size=50076, nrcpt=1 (queue active)
Jun 28 12:40:31 mx1 postfix/qmgr[29326]: B98E03262CE: from=<noreply@panix.com>, size=50076, nrcpt=1 (queue active)
Jun 28 14:10:31 mx1 postfix/qmgr[29326]: B98E03262CE: from=<noreply@panix.com>, size=50076, nrcpt=1 (queue active)

To check details I have to do this.

root@mx1:~# grep B98E03262CE /var/log/mail.log

Jun 28 08:10:31 mx1 postfix/qmgr[29326]: B98E03262CE: from=<noreply@panix.com>, size=50076, nrcpt=1 (queue active)
Jun 28 08:10:33 mx1 postfix/smtp[27281]: B98E03262CE: host mx.panix.com[166.84.1.72] said: 454 <noreply@panix.com>: Sender address rejected: Internal error- please contact staff@panix.com (in reply to RCPT TO command)
Jun 28 08:10:35 mx1 postfix/smtp[27281]: B98E03262CE: to=<mazrob@panix.com>, relay=mx.panix.com[166.84.1.73]:25, delay=75617, delays=75614/0/2.8/0.38, dsn=4.0.0, status=deferred (host mx.panix.com[166.84.1.73] said: 454 <noreply@panix.com>: Sender address rejected: Internal error- please contact staff@panix.com (in reply to RCPT TO command))

My question is, How can I check all mails with their IDs with a single line command. Anybody please help?

Thanks in advanced.

Try (if i understood correctly..)

 egrep "from=<noreply@panix.com>|B98E03262CE" /var/log/mail.log

Dear Peasant, thank you very much for your reply. But it will show only only log. I want to see all the logs at a time with a single line command.

It can be done bye AWK. I saw a person to do it some days ago.

Any idea?