Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: Re: Yet another Apache log question

by barrd (Parson)
on Dec 16, 2003 at 18:24 UTC ( #315104=note: print w/ replies, xml ) Need Help??


in reply to Re: Yet another Apache log question
in thread Yet another Apache log question

Aah... pooh ;)

OK, could you post the CustomLog directive line from your conf file so we can have a look?

Ta


Comment on Re: Re: Yet another Apache log question
Download Code
Re: Yet another Apache log question
by CHRYSt (Acolyte) on Dec 16, 2003 at 19:13 UTC
    Sure.

    The logging directives are:

    LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
    CustomLog /var/www/intra-access_log combined env=!image

    The current incarnation of the script I'm using. This is taken directly from the documentation, and though it's not the data I'm looking for, at this point I'd just like to at least get it to parse the log:

    #!/usr/local/bin/perl $|++; use Apache::ParseLog; + $conf = "/path/to/httpd.conf"; $base = new Apache::ParseLog($conf); + $log = $base->getCustomLog("combined"); %user = $log->user(); print "Users Report\n"; foreach (sort keys %user) { print "$_:\t$user{$_}\n" unless m/^-$/; } + exit; +

      Righty ho...

      First thing, update your locate database:

      foo:~# updatedb
      This may take a wee while... be patient. Then ensure that where you have said in your script that intra-access_log and your apache httpd.conf files are where you think they are:
      foo:~# locate httpd.conf /etc/apache/httpd.conf
      And...
      foo:~# locate intra-access_log /var/www/intra-access_log
      I'm kinda clutching at straws here as the formatting of LogFormat and CustomLog don't scream out any obvious errors...
Re: Re: Re: Yet another Apache log question
by NodeReaper (Curate) on Dec 16, 2003 at 19:18 UTC

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (4)
As of 2014-11-27 19:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My preferred Perl binaries come from:














    Results (187 votes), past polls