class

ApacheLogRegex

Inherits Reference < Object

Constructors

new(format)

Initializes a new parser instance with given log <tt>format</tt>.

Source

Instance methods

format

The normalized log file format. Some common formats:

Common Log Format (CLF) '%h %l %u %t "%r" %>s %b'

Common Log Format with Virtual Host '%v %h %l %u %t "%r" %>s %b'

NCSA extended/combined log format '%h %l %u %t "%r" %>s %b "%{Referer}i" "%{User-agent}i"'

Source
names

The list of field names that extracted from log format.

Source
parse(line)

Parses <tt>line</tt> according to current log <tt>format</tt> and returns an hash of log field => value on success. Returns <tt>nil</tt> if <tt>line</tt> doesn't match current log <tt>format</tt>.

Source
parse!(line)

Same as <tt>ApacheLogRegex#parse</tt> but raises a <tt>ParseError</tt> if <tt>line</tt> doesn't match current <tt>format</tt>.

==== Raises

ParseError:: if <tt>line</tt> doesn't match current <tt>format</tt>

Source
parse_format(format) : String

Parse log <tt>format</tt> into a suitable Regexp instance.

Source
regexp

Regexp instance used for parsing a log line.

Source
rename_this_name(name)

Overwrite this method if you want to use some human-readable name for log fields. This method is called only once at <tt>parse_format</tt> time.

Source

Nested types