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

regexp matching bad stuff ...

by raiten (Acolyte)
on Oct 09, 2009 at 14:32 UTC ( #800290=perlquestion: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    $ cat access_log | perl -pe 'if (s/^(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3
    +}).*"(GET|POST|HEAD) (.*?) HTTP\/.*$/$1,$3/) { print } else { print S
    +TDERR }' 2>out.err > out.csv
    
  2. or download this
    [...]
    72.30.161.243,/
    ...
    125.224.206.168 - - [04/Oct/2009:00:13:47 +0200] "CONNECT 203.188.201.
    +253:25 HTTP/1.1" 404 516
    96.243.255.188,//phpMyAdmin/
    [...]
    
  3. or download this
    72.30.161.243 - - [03/Oct/2009:17:21:43 +0200] "GET / HTTP/1.0" 404 51
    +6 "-" "Mozilla/5.0 (compatible; Yahoo! Slurp/3.0; http://help.yahoo.c
    +o
    m/help/us/ysearch/slurp)"
    ...
    125.224.206.168 - - [04/Oct/2009:00:13:47 +0200] "CONNECT 203.188.201.
    +253:25 HTTP/1.1" 404 516
    96.243.255.188 - - [04/Oct/2009:00:26:17 +0200] "GET //phpMyAdmin/ HTT
    +P/1.1" 404 516 "-" "Mozilla/4.0 (compatible; MSIE 6.0; Windows 98)"
    96.243.255.188 - - [04/Oct/2009:00:26:17 +0200] "GET //phpMyAdmin/ HTT
    +P/1.1" 404 516
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://800290]
Approved by moritz
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (5)
As of 2018-06-19 05:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?



    Results (111 votes). Check out past polls.

    Notices?