khuff71
asked on
AIX script to parse records inside a file
I need to write an AIX script to parse the records inside the file /var/log/mail.log. Here are a few records from the log.
Aug 1 13:51:33 domain sendmail[37804]: NAA99708: to=user@domain2.com, ctladdr=fr
ank (205/1), delay=00:00:01, xdelay=00:00:00, mailer=relay, relay=mail.domain.co
m. [::ffff:192.168.25.3], stat=Sent (2.6.0 <200708011851.NAA99708@dom ain.domain
.com> Queued mail for delivery)
Aug 1 13:51:34 domain sendmail[91206]: NAA56130: to=user@domain2.com, ctladdr=f
rank (205/1), delay=00:00:01, xdelay=00:00:01, mailer=relay, relay=mail.domain.c
om. [::ffff:192.168.25.3], stat=Sent (2.6.0 <200708011851.NAA56130@dom ain.domain .com> Queued mail for delivery)
Aug 1 13:51:34 domain sendmail[99712]: NAA74982: to=user@domain2.com, ctladdr=fr
ank (205/1), delay=00:00:01, xdelay=00:00:01, mailer=relay, relay=mail.domain.co
m. [::ffff:192.168.25.3], stat=Sent (2.6.0 <200708011851.NAA74982@dom ain.domain .com> Queued mail for delivery)
What I want out of it is:
Aug 1 13:51:34 to=user@domain2.com <200708011851.NAA74982@dom ain.domain .com>
Can anyone help? I do not know where to begin. I am a novice at AIX scripts.
Aug 1 13:51:33 domain sendmail[37804]: NAA99708: to=user@domain2.com, ctladdr=fr
ank (205/1), delay=00:00:01, xdelay=00:00:00, mailer=relay, relay=mail.domain.co
m. [::ffff:192.168.25.3], stat=Sent (2.6.0 <200708011851.NAA99708@dom
.com> Queued mail for delivery)
Aug 1 13:51:34 domain sendmail[91206]: NAA56130: to=user@domain2.com, ctladdr=f
rank (205/1), delay=00:00:01, xdelay=00:00:01, mailer=relay, relay=mail.domain.c
om. [::ffff:192.168.25.3], stat=Sent (2.6.0 <200708011851.NAA56130@dom
Aug 1 13:51:34 domain sendmail[99712]: NAA74982: to=user@domain2.com, ctladdr=fr
ank (205/1), delay=00:00:01, xdelay=00:00:01, mailer=relay, relay=mail.domain.co
m. [::ffff:192.168.25.3], stat=Sent (2.6.0 <200708011851.NAA74982@dom
What I want out of it is:
Aug 1 13:51:34 to=user@domain2.com <200708011851.NAA74982@dom
Can anyone help? I do not know where to begin. I am a novice at AIX scripts.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER