I have a log file that I need to get the domain from the 8th field with out the user name, all domains except
for ones containing (my.domain.com) then get a count on each uniq domain name and number of how many times found.
I can get it but doing it the hard way, need to put it in a perl script.
I'm useing this right now.
First I use this to get my 8th field with out any that contain my.domain.com
# grep 'tcp channel' mail.log_yesterday | awk '{print $8}' | grep -iv my.domain.com | sort| uniq -c | sort -nr
Then I put it in a file so I can use VI and remove the user name up to and including the @ (user2@)
Then I can sort and uniq it again.
:%s/^.@=//
Here is the format of the lines, has to be a much easier way, I got it partly working with perl match but can get it
right.
Need the (domain only) from the 8th field unless it contains (my.domain.com) then uniq and sort
26-Jul-2005 00:37:47.16 tcp channel E 12 wutbsop@nitecs.com rfc822;JohnD@find.domain.c
om JohnD@find.domain.com
mail/queue/xchannel/014/ZZ
0IK7009K7L
QZJE.00 <XTZIIJJYUujgyfj@heart.org
> mailsrv 130.166.52.125 ([220.243.2
05.35])
Thanks for any imput
Start Free Trial