Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

RE: Re: Acolyte needs regex help

by Dungan (Initiate)
on Jun 24, 2000 at 05:44 UTC ( #19690=note: print w/replies, xml ) Need Help??


in reply to Re: Acolyte needs regex help
in thread Acolyte needs regex help

Thanks you all much I came up with this as my final code <CODE> #! /usr/bin/perl -w use strict; my $goodFILE = "/logs/goodstring.txt"; my $badFILE = "/logs/badstring.txt"; my $logFILE = "/logs/processing/uexpress/access.20000622"; open(GOOD , ">$goodFILE") || die "cannot create $goodFILE : !$\n"; open(BAD , ">$badFILE") || die "cannot create $badFILE : !$\n"; open(FILE, "$logFILE"); while (<FILE>) { if ( /^(\S+) (\S+) (\S+) \[(^:+):(\d+:\d+:\d+) (\S+)\] "(\S+) (\S+) (\S+)" (\S+) (\S+) "(.*?)" "(.*?)"$/) { my ($client,$identuser,$authuser,$date,$time,$tz,$method,$url,$protocol,$status,$bytes,$refer,$platform) = ($1,$2,$3 ,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13); print GOOD "client : $client\n"; print GOOD "userid : $identuser\n"; print GOOD "authuser : $authuser\n"; print GOOD "date : $date\n"; print GOOD "time : $time\n"; print GOOD "time zone : $tz\n"; print GOOD "method : $method\n"; print GOOD "URL : $url\n"; print GOOD "protocol : $protocol\n"; print GOOD "status : $status\n"; print GOOD "byte

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (3)
As of 2021-04-12 02:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?