ANN: Apache::LogRegex 1.2

From: Peter Hickman (peter_at_semantico.com)
Date: 08/13/04


Date: Fri, 13 Aug 2004 09:46:35 +0100

Apache::LogRegex - Parse a line from an Apache logfile into a hash

This document refers to version 1.2 of Apache::LogRegex, released August 12nd, 2004

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.

A minor update to allow the use of \" in the Referer field



Relevant Pages

  • [ANN] Apache::LogRegex 1.1 minor bugfix release
    ... Apache::LogRegex - Parse a line from an Apache logfile into a hash ... Designed as a simple class to parse Apache log files. ... The field names of the hash are derived from the log file format. ...
    (comp.lang.perl.modules)
  • ANNOUNCE: Apache::LogRegex 1.0
    ... Apache::LogRegex - Parse a line from an Apache logfile into a hash ... Designed as a simple class to parse Apache log files. ... lines from the log file line by line returning a hash of each line. ...
    (comp.lang.perl.modules)
  • Re: Use of hashes and speed - suggestions ?
    ... > One of the things I need to do is build a cross reference map from one ... and for this I guess I use a hash. ... > log file that might look something like this ... hash lookups are constant time: ...
    (comp.lang.perl.misc)
  • Re: Use of hashes and speed - suggestions ?
    ... >>> I have a requirement to parse a very large log file, ... > I guess you mean store a null in the 'created_map' hash. ... >> Nowhere here do you use %map in any meaningful way. ... talk about lists, I assume that refers to some alternative code you have in ...
    (comp.lang.perl.misc)
  • Re: Use of hashes and speed - suggestions ?
    ... >> I have a requirement to parse a very large log file, ... >> hash with the key being the value and the value being the key from ... Well, actually, the first bit, filling the 'map' hash, will have a ... I reference %map within the ...
    (comp.lang.perl.misc)