The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

Logfile::EPrints::Hit - Generic 'hit' object

DESCRIPTION

This object represents a single entry in a log file and doesn't proscribe any particular schema.

This uses the 'AUTOLOAD' mechanism to allow any variable to be defined as a method.

'Hit' objects are passed between filters that may add additional functionality (e.g. by subclassing the hit object).

SYNOPSIS

        use Logfile::EPrints::Hit;

        my $hit = Logfile::EPrints::Hit->new;
        $hit->date( '2006-05-01 23:10:05' );

        print $hit->date;

NAME

Logfile::EPrints::Hit::Combined - Parse combined logs like those generated from Apache

SYNOPSIS

        use Logfile::EPrints::Hit;

        my $hit = Logfile::EPrints::Hit::Combined->new($line);

        printf("%s requested %s\n",
                $hit->hostname,
                $hit->page);

METHODS

address()

IP address (or hostname if IP address could not be found).

hostname()

Hostname (undef if the address is an IP without a reverse DNS entry).

date()

Apache formatted date/time.

datetime()

Date/time formatted as yyyymmddHHMMSS.

userid_identd()
identd()
request()

Request string.

code()

HTTP server code.

size()

HTTP server response size.

referrer()

User agent referrer.

agent()

User agent string.

method()

Request method (GET, HEAD etc.).

page()

Requested page - probably won't include the virtual host!

version()

HTTP version requested (HTTP/1.1 etc).

country()

Country that the IP is probably in (according to GeoIP).

homepage()

Home page of the requesting user's service provider, i.e. www.<hostname>. Performs an on-demand HTTP request.

institution()

Title of the user's home page. Performs an on-demand HTTP request, with the result cached by the class.

AUTHOR

Tim Brody - <tdb01r@ecs.soton.ac.uk>