Hi Derek.
Derek Romeyn wrote:
> Using your idea I ended up with data like this. Which is odd because
> the database should only include 400 and 500 type errors.
>
[snip]
>
> 404 24.54.175.153 - - [11/Mar/2003:07:48:37 -0800] "GET
> /e/t/invest/img/spacer.gif HTTP/1.1" 404 0 "https://
> 370
"R. Joseph Newton" wrote:
... an integer, followed by a *backslash*. # HTTP\d+\/
> There will be something on the other side of the *backslash*, to identify
> subversion. Let's not count
baskslash? Did somebody say "backslash"? Huh? I didn't hear anything. <| 8-O )
Joseph
--
To unsubsc
"Romeyn, Derek" wrote:
So I went ahead and modified it to print the code and the dataline and got
Hi Derek,
Take some time here to look at the string, and think about how you know which part is
the error code. Is it just because you find a space after "HTTP"? It seems to me
that there are some
Derek Romeyn wrote:
> Using your idea I ended up with data like this. Which is odd because the
> database should only include 400 and 500 type errors.
>
> 176
> 404
> 370
> 157
> 404
> 370
> 526
> 178
> 176
> 404
> 526
> 526
>
> So I went ahead and modified it to print the code and the dataline
Derek Romeyn wrote:
> K, I tried this and it didn't work as expected:
>
> $code =~ / HTTP\/\d\.\d\" (\d+)/;
> if (!$code) {
> print "NEXT\n";
> next;
> }
> print "$code\n";
>
>
> The loop just printed NEXT 300 or so times. I was t
"Romeyn, Derek" wrote:
> K, I tried this and it didn't work as expected:
>
> $code =~ / HTTP\/\d\.\d\" (\d+)/;
> if (!$code) {
> print "NEXT\n";
> next;
> }
> print "$code\n";
>
> The loop just printed NEXT 300 or so times. I was thi
ariations though.
Derek
-Original Message-
From: Brett W. McCoy [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 12, 2003 11:02 AM
To: Romeyn, Derek
Cc: 'George P.'; '[EMAIL PROTECTED]'
Subject: RE: Regular Expressions http error code
On Wed, 12 Mar 2003, Brett W. McCoy wrot
On Wed, 12 Mar 2003, Brett W. McCoy wrote:
> You're not capturing the correct string. Here's a code snippet I just
> tried on an Apache log that worked (assuming you have an open file
> handle):
>
> while() {
> print "$1\n" if m|HTTP.*\s+(\d{3})|g';
> }
>
> $1 contains the matched string in
ot;NEXT\n";
next;
}
bye,
George P.
>
>
>
>
>
>
> -Original Message-
> From: George P. [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, March 12, 2003 9:48 AM
> To: Romeyn, Derek
> Cc: '[EMAIL PROTECTED]'
> Subject: Re: Regular Expres
On Wed, 12 Mar 2003, Romeyn, Derek wrote:
> K, I tried this and it didn't work as expected:
>
> $code =~ / HTTP\/\d\.\d\" (\d+)/;
> if (!$code) {
> print "NEXT\n";
> next;
> }
> print "$code\n";
>
>
> The loop just printed NEXT 300 or
>
> K, I tried this and it didn't work as expected:
>
> $code =~ / HTTP\/\d\.\d\" (\d+)/;
> if (!$code) {
> print "NEXT\n";
> next;
> }
> print "$code\n";
>
>
> The loop just printed NEXT 300 or so times. I was thinking
> that $
hat $code would
equal whatever was in the parentheses. Am I still not getting this?
-Original Message-
From: George P. [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 12, 2003 9:48 AM
To: Romeyn, Derek
Cc: '[EMAIL PROTECTED]'
Subject: Re: Regular Expressions http error co
On Wed, 12 Mar 2003, Romeyn, Derek wrote:
> I have a DB that records HTTP log data like this. I'm horrible at regular
> expressions and could use some real help in pulling out the HTTP error code
> from lines that look like this.
>
> 65.248.129.126 - xm1721 [11/Mar/2003:05:41:35 -0800] "POST
> /
13 matches
Mail list logo