Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: Parsing Apache Log to Get Most Recent File Access

by Ovid (Cardinal)
on Nov 25, 2002 at 22:22 UTC ( #215744=note: print w/replies, xml ) Need Help??


in reply to Parsing Apache Log to Get Most Recent File Access

Why not Apache::ParseLog?

Cheers,
Ovid

New address of my CGI Course.
Silence is Evil (feel free to copy and distribute widely - note copyright text)

  • Comment on Re: Parsing Apache Log to Get Most Recent File Access

Replies are listed 'Best First'.
Re: Re: Parsing Apache Log to Get Most Recent File Access
by enoch (Chaplain) on Nov 25, 2002 at 23:02 UTC
    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

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (4)
As of 2023-12-08 16:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What's your preferred 'use VERSION' for new CPAN modules in 2023?











    Results (36 votes). Check out past polls.

    Notices?