Re: get quote enclosed field in a line

2008-04-18 Thread Michael Tosch
[EMAIL PROTECTED] wrote: > is there a simple way in perl, python, or awk/shell/pipe, that gets > the user agent field in a apache log? > > e.g. the typical line is like this: > > 189.139.109.235 - - [07/Apr/2008:00:00:16 -0400] "GET / > Periodic_dosage_dir/lacru/manara.html HTTP/1.1" 200 1933 xah

Re: get quote enclosed field in a line

2008-04-17 Thread Skye [EMAIL PROTECTED]
> [EMAIL PROTECTED] wrote: > > is there a simple way in perl, python, or awk/shell/pipe, that gets > > the user agent field in a apache log? > Something like: > # cut -d '"' -f 6 < httpd-access.log > ? > -- > mph Doesn't it feel like autosplit mode never gets any run time? perl -laF'"' -ne'print

Re: get quote enclosed field in a line

2008-04-17 Thread Penny Y.
Hello, I don't know Python's RE very well. But using Perl's RE you can get it. > cat t1.pl $x=qq{189.139.109.235 - - [07/Apr/2008:00:00:16 -0400] "GET /Periodic_dosage_dir/lacru/manara.html HTTP/1.1" 200 1933 xahlee.org "http://xahlee.org/Periodic_dosage_dir/lacru/manara2.html"; "Mozilla/5.0 (Wi

Re: get quote enclosed field in a line

2008-04-17 Thread Paul McGuire
On Apr 17, 6:50 pm, John Machin <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > is there a simple way in perl, python, or awk/shell/pipe, that gets > > the user agent field in a apache log? > > > e.g. the typical line is like this: > > > 189.139.109.235 - - [07/Apr/2008:00:00:16 -0400] "G

Re: get quote enclosed field in a line

2008-04-17 Thread Carsten Haese
John Machin wrote: > [EMAIL PROTECTED] wrote: >> is there a simple way in perl, python, or awk/shell/pipe, that gets >> the user agent field in a apache log? > If you don't like that, just hang about -- there's sure to be a > pyparsing bus coming by real soon now :-) While we're waiting for the

Re: get quote enclosed field in a line

2008-04-17 Thread John Machin
Martin P. Hellwig wrote: > > Something like: > # cut -d '"' -f 6 < httpd-access.log In Python: line.split('"')[5] -- http://mail.python.org/mailman/listinfo/python-list

Re: get quote enclosed field in a line

2008-04-17 Thread John Machin
[EMAIL PROTECTED] wrote: > is there a simple way in perl, python, or awk/shell/pipe, that gets > the user agent field in a apache log? > > e.g. the typical line is like this: > > 189.139.109.235 - - [07/Apr/2008:00:00:16 -0400] "GET / > Periodic_dosage_dir/lacru/manara.html HTTP/1.1" 200 1933 xah

Re: get quote enclosed field in a line

2008-04-17 Thread Martin P. Hellwig
[EMAIL PROTECTED] wrote: > is there a simple way in perl, python, or awk/shell/pipe, that gets > the user agent field in a apache log? > > e.g. the typical line is like this: > > 189.139.109.235 - - [07/Apr/2008:00:00:16 -0400] "GET / > Periodic_dosage_dir/lacru/manara.html HTTP/1.1" 200 1933 xah

get quote enclosed field in a line

2008-04-17 Thread [EMAIL PROTECTED]
is there a simple way in perl, python, or awk/shell/pipe, that gets the user agent field in a apache log? e.g. the typical line is like this: 189.139.109.235 - - [07/Apr/2008:00:00:16 -0400] "GET / Periodic_dosage_dir/lacru/manara.html HTTP/1.1" 200 1933 xahlee.org "http://xahlee.org/Periodic_dos