Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: Re: Parsing Apache Log to Get Most Recent File Access

by enoch (Chaplain)
on Nov 25, 2002 at 23:02 UTC ( #215753=note: print w/ replies, xml ) Need Help??


in reply to Re: Parsing Apache Log to Get Most Recent File Access
in thread Parsing Apache Log to Get Most Recent File Access

I installed Apache::ParseLog and started playing around with it. Here is my quick mock-up code with it:

#!/usr/bin/perl use warnings; use strict; use Apache::ParseLog; my $parseObj = new Apache::ParseLog(); $parseObj = $parseObj->config(transferlog => '/usr/local/apache/logs/access_lo +g'); my $transferLog = $parseObj->getTransferLog(); my %hosts = $transferLog->host(); foreach my $key (keys %hosts) { print "$key => $hosts{$key}\n"; }
The problem is that none of the hashes you can access via it's methods contain all three items I am looking for -- IP, filename, and date. Here are all the methods that return information about the logs. None of them return a hash having all the info I want. The two closest methods are host() which returns a hash keyed in by IP's with the value being the total times that that IP has come to the site. And, then there's hitbydatetime() which returns a hash keyed in by datetime stamps with the value being the number of hits at that time. But, I can't cross-reference one with the other.

enoch


Comment on Re: Re: Parsing Apache Log to Get Most Recent File Access
Select or Download Code

Log In?
Username:
Password:

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

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

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





    Results (44 votes), past polls