[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
> [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
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
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
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
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
[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
[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
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