Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: Extracting Pattern Match from log

by rob_au (Abbot)
on Jan 28, 2004 at 11:32 UTC ( #324646=note: print w/ replies, xml ) Need Help??


in reply to Extracting Pattern Match from log

Whilst I don't have any logs with myDoom virus attempts to test with, this should do the trick for you ...

perl -MEmail::Valid::Loose -nle 'print $1 if /450 <($Email::Valid::Loo +se::Addr_spec_re)>/' < /var/log/mail/info

Or if you really want quick-and-dirty with a very loosely matching regular expression ...

perl -nle 'print $1 if /450 <([^\>]+)>/' < /var/log/mail/info

 

perl -le "print unpack'N', pack'B32', '00000000000000000000001010111010'"


Comment on Re: Extracting Pattern Match from log
Select or Download Code
Replies are listed 'Best First'.
Re: Re: Extracting Pattern Match from log
by darxide1982 (Initiate) on Jan 28, 2004 at 11:42 UTC
    Works great, thanks :)

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://324646]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (7)
As of 2015-07-30 05:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (270 votes), past polls