Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: Yet another Apache log question

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


in reply to Yet another Apache log question

Hi CHRYst,

Apache::ParseLog::getCustomLog: combined does not exist...
Did you put in a full path to the 'combined' log? i.e. something along the lines of:
$log = $base->getCustomLog('/var/log/apache/combined');

That, I think could be the problem...?


Comment on Re: Yet another Apache log question
Download Code
Re: Yet another Apache log question
by CHRYSt (Acolyte) on Dec 16, 2003 at 18:08 UTC
    Unfortunately not.

    The getCustomLog("value") requires the nickname of the log. It appears that it parses the apache conf file, and determines the log path based on the CustomLog directive that states "combined" as it's nickname.
      Aah... pooh ;)

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

      Ta

        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; +

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (14)
As of 2014-12-18 18:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (59 votes), past polls