Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: Call for code samples!

by argus (Acolyte)
on Nov 15, 2001 at 23:15 UTC ( [id://125645]=note: print w/replies, xml ) Need Help??


in reply to Call for code samples!

Not sure if this is what you are looking for, but this is something I wrote to parse some log files while running load tests on DNS servers:

if(m/(([0-9]+)-((?:jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec))-( +[0-9]+))\s+((?:0?[0-9]|1[0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9].[0-9]{3}) +\s+(.*)\/(\d+.\d+.\d+.\d+)\/($lookingfor)\/(a).*/i) { ## Notes: # $1 = Whole Date (DD-MMM-YYYY) # $2 = Day (DD) # $3 = Month (MMM as text) # $4 = Year (YYYY) # $5 = Time (HH:MM:SS.sss) # $6 = Queries info stuff (is not used) # $7 = IP of requesting name server # $8 = what we look for ($lookingfor variable) # $9 = type of record (A/MX/CNAME) }
not awfully complicated, though.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (5)
As of 2024-04-25 10:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found