Apache-LogRegex

 view release on metacpan or  search on metacpan

README.md  view on Meta::CPAN

Apache::LogRegex
================

*Parse a line from an Apache logfile into a hash*

Designed as a simple class to parse Apache log files. It will construct a regex that will parse the given log file format and can then parse lines from the log file line by line returning a hash of each line.

The field names of the hash are derived from the log file format. Thus if the format is '%a %t \"%r\" %s %b %T \"%{Referer}i\" ...' then the keys of the hash will be %a, %t, %r, %s, %b, %T and %{Referer}i.

Should these key names be unusable, as I guess they probably are, then subclass and provide an override rename_this_name() method that can rename the keys before they are added in the array of field names.

INSTALLATION
------------

    % perl Makefile.PL
    % make
    % make test
    % sudo make install

TEST FAILURES

lib/Apache/LogRegex.pm  view on Meta::CPAN

=head2 Overview

A simple class to parse Apache access log files. It will construct a
regex that will parse the given log file format and can then parse
lines from the log file line by line returning a hash of each line.

The field names of the hash are derived from the log file format. Thus if
the format is '%a %t \"%r\" %s %b %T \"%{Referer}i\" ...' then the keys of
the hash will be %a, %t, %r, %s, %b, %T and %{Referer}i.

Should these key names be unusable, as I guess they probably are, then subclass
and provide an override rename_this_name() method that can rename the keys
before they are added in the array of field names.

This module supports variable spacing between elements that are
surrounded by quotes, so if you have more than one space between those
elements in your format or in your log file, that should be OK.

=head1 SUBROUTINES/METHODS

=head2 Constructor



( run in 0.542 second using v1.01-cache-2.11-cpan-702932259ff )