|
Posted by Peter Hickman on August 13, 2004, 10:46 am
Please log in for more thread options
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 "%i" ...' then the
keys of the hash will be %a, %t, %r, %s, %b, %T and %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
|