grippo 0.2.2

Parse, match and scrub data faster and more efficiently.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# mod_log_config %u: an authenticated user name, which may be an email address.
HTTPDUSER (?:%{EMAILADDRESS}|%{USER})
# Error log `[%t]` as written by ctime: day name, month, day, time with optional microseconds, year.
HTTPDERROR_DATE %{DAY} %{MONTH} %{MONTHDAY} %{TIME} %{YEAR}

# LogFormat `%h %l %u %t "%r" %>s %b`, where %b is `-` for zero bytes and the request line is an HTTP method, target and version. A WebDAV method can carry a hyphen.
HTTPD_COMMONLOG %{IPORHOST:clientip} %{HTTPDUSER:ident} %{HTTPDUSER:auth} \[%{HTTPDATE:timestamp}\] "(?:(?<verb>[A-Za-z][A-Za-z-]*) %{NOTSPACE:request}(?: HTTP/%{NUMBER:httpversion})?|%{DATA:rawrequest})" (?:-|%{NONNEGINT:response}) (?:-|%{NONNEGINT:bytes})
# The combined format adds `"%{Referer}i" "%{User-agent}i"`.
HTTPD_COMBINEDLOG %{HTTPD_COMMONLOG} %{QS:referrer} %{QS:agent}

# Httpd 2.2 error log: `[time] [level] [client addr] message`.
HTTPD20_ERRORLOG \[%{HTTPDERROR_DATE:timestamp}\] \[%{LOGLEVEL:loglevel}\] (?:\[client %{IPORHOST:clientip}\] )?%{GREEDYDATA:message}
# Httpd 2.4 ErrorLogFormat default: `[time] [module:level] [pid N:tid N] (os error)text: [client addr:port] AHnnnnn: message`, where message ids are AH and five digits.
HTTPD24_ERRORLOG \[%{HTTPDERROR_DATE:timestamp}\] \[(?:%{WORD:module})?:%{LOGLEVEL:loglevel}\] \[pid %{POSINT:pid}(?::tid %{NUMBER:tid})?\](?: \((?<proxy_errorcode>[0-9]+)\)%{DATA:proxy_message}:)?(?: \[client %{IPORHOST:clientip}:%{POSINT:clientport}\])?(?: (?<errorcode>AH[0-9]{5}):)? %{GREEDYDATA:message}
HTTPD_ERRORLOG (?:%{HTTPD20_ERRORLOG}|%{HTTPD24_ERRORLOG})

COMMONAPACHELOG %{HTTPD_COMMONLOG}
COMBINEDAPACHELOG %{HTTPD_COMBINEDLOG}