Advertisement

07.27.2005 at 11:14AM PDT, ID: 21506549
[x]
Attachment Details

Perl grep and sort

Asked by bt707 in Perl Programming Language

Tags: , ,

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.com JohnD@find.domain.com
mail/queue/xchannel/014/ZZ0IK7009K7LQZJE.00 <XTZIIJJYUujgyfj@heart.org> mailsrv 130.166.52.125 ([220.243.2
05.35])

Thanks for any imputStart Free Trial
[+][-]07.27.2005 at 11:43AM PDT, ID: 14539881

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.27.2005 at 11:46AM PDT, ID: 14539908

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.27.2005 at 01:31PM PDT, ID: 14540790

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.27.2005 at 01:42PM PDT, ID: 14540877

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.27.2005 at 01:46PM PDT, ID: 14540901

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Perl Programming Language
Tags: perl, grep, sort
Sign Up Now!
Solution Provided By: ozo
Participating Experts: 3
Solution Grade: A
 
 
[+][-]07.27.2005 at 01:58PM PDT, ID: 14540990

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.27.2005 at 02:18PM PDT, ID: 14541134

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.27.2005 at 02:18PM PDT, ID: 14541135

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.27.2005 at 02:19PM PDT, ID: 14541141

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.27.2005 at 02:20PM PDT, ID: 14541152

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.27.2005 at 02:45PM PDT, ID: 14541367

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.27.2005 at 02:46PM PDT, ID: 14541375

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.27.2005 at 02:48PM PDT, ID: 14541391

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.27.2005 at 02:48PM PDT, ID: 14541395

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.27.2005 at 02:49PM PDT, ID: 14541408

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.27.2005 at 02:50PM PDT, ID: 14541416

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.27.2005 at 02:52PM PDT, ID: 14541429

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.27.2005 at 02:53PM PDT, ID: 14541440

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.27.2005 at 03:56PM PDT, ID: 14541776

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.28.2005 at 04:44AM PDT, ID: 14544651

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.28.2005 at 06:17AM PDT, ID: 14545265

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.28.2005 at 11:04PM PDT, ID: 14552223

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.29.2005 at 04:18AM PDT, ID: 14553487

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.30.2005 at 04:30AM PDT, ID: 14561017

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32