grippo 0.1.2

Parse, match and scrub data at scale.
Documentation
# Aliases.
USER %{USERNAME}
QS %{QUOTEDSTRING}
DATA .*?

# Hexadecimal floating constants: optional sign and 0x, hex digits with an optional point.
BASE16FLOAT [+-]?(?:0[xX])?(?:[0-9A-Fa-f]+(?:\.[0-9A-Fa-f]*)?|\.[0-9A-Fa-f]+)

# RFC 8141: urn:NID:NSS with the optional ?+r-component, ?=q-component and #f-component.
URN [Uu][Rr][Nn]:[0-9A-Za-z][0-9A-Za-z-]{0,30}[0-9A-Za-z]:(?:[0-9A-Za-z._~!$&'()*+,;=:@-]|%[0-9A-Fa-f]{2})(?:[0-9A-Za-z._~!$&'()*+,;=:@/-]|%[0-9A-Fa-f]{2})*(?:\?\+(?:[0-9A-Za-z._~!$&'()*+,;=:@-]|%[0-9A-Fa-f]{2})(?:[0-9A-Za-z._~!$&'()*+,;=:@/?-]|%[0-9A-Fa-f]{2})*)?(?:\?=(?:[0-9A-Za-z._~!$&'()*+,;=:@-]|%[0-9A-Fa-f]{2})(?:[0-9A-Za-z._~!$&'()*+,;=:@/?-]|%[0-9A-Fa-f]{2})*)?(?:#(?:[0-9A-Za-z._~!$&'()*+,;=:@/?-]|%[0-9A-Fa-f]{2})*)?

# MAC notations: Cisco dotted quads, IEEE 802 hyphens, and colons.
CISCOMAC (?:[A-Fa-f0-9]{4}\.){2}[A-Fa-f0-9]{4}
WINDOWSMAC (?:[A-Fa-f0-9]{2}-){5}[A-Fa-f0-9]{2}
COMMONMAC (?:[A-Fa-f0-9]{2}:){5}[A-Fa-f0-9]{2}

# RFC 3986: port is any run of digits, and an IPv6 host is written in brackets.
HOSTPORT %{IPORHOST}:%{PORT}
URIHOST (?:\[%{IPV6}\]|%{IPORHOST})(?::%{PORT:port})?
URIPATHPARAM %{URIPATH}(?:%{URIPARAM})?
URI %{URIPROTO}://(?:[A-Za-z0-9._~!$&'()*+,;=:%-]*@)?(?:%{URIHOST})?(?:%{URIPATHPARAM})?

# POSIX absolute paths and Windows drive or UNC paths.
PATH (?:%{UNIXPATH}|%{WINPATH})

# Linux pts(4) and tty(4) device names, and BSD ttyp0 or macOS ttys003.
TTY /dev/(?:pts/|tty[A-Za-z]*)[0-9]+

# Calendar months 1-12, day names, and the numeric dates built on them.
MONTHNUM (?:0?[1-9]|1[0-2])
MONTHNUM2 (?:0[1-9]|1[0-2])
DAY (?:Mon(?:day)?|Tue(?:sday)?|Wed(?:nesday)?|Thu(?:rsday)?|Fri(?:day)?|Sat(?:urday)?|Sun(?:day)?)
DATE_US %{MONTHNUM}[/-]%{MONTHDAY}[/-]%{YEAR}
DATE_EU %{MONTHDAY}[./-]%{MONTHNUM}[./-]%{YEAR}
DATE %{DATE_US}|%{DATE_EU}
DATESTAMP %{DATE}[- ]%{TIME}

# ISO 8601 seconds: two digits, 00 to 60, with a point or comma fraction.
ISO8601_SECOND (?:[0-5][0-9]|60)(?:[.,][0-9]+)?

# RFC 822 section 5.1 zones, plus the Atlantic and Pacific abbreviations logs also use.
TZ (?:UTC|UT|GMT|[APMCE][SD]T)

# RFC 822 and RFC 5322 date-time: optional day name, day month year, time, then a numeric or named zone.
# RFC 5322 writes +hhmm, and +hh:mm is kept because logs write it.
DATESTAMP_RFC822 (?:%{DAY} %{MONTH} %{MONTHDAY} %{YEAR} %{TIME} %{TZ}|(?:%{DAY}, )?%{MONTHDAY} %{MONTH} %{YEAR} %{TIME} (?:[+-][0-9]{4}|%{TZ}))
DATESTAMP_RFC2822 (?:%{DAY}, )?%{MONTHDAY} %{MONTH} %{YEAR} %{TIME} (?:[+-][0-9]{2}:?[0-9]{2}|%{TZ}|Z)

# POSIX date(1) default output, where %e pads a single-digit day with a space.
DATESTAMP_OTHER %{DAY} %{MONTH} +%{MONTHDAY} %{TIME} %{TZ} %{YEAR}

# Fixed-width yyyyMMddHHmmss.
DATESTAMP_EVENTLOG [0-9]{4}(?:0[1-9]|1[0-2])(?:0[1-9]|[12][0-9]|3[01])(?:[01][0-9]|2[0-3])[0-5][0-9](?:[0-5][0-9]|60)

# RFC 3164 section 4.1: TAG ends at the first non-alphanumeric that is not part of the program name, here ':', '[' or ']'.
PROG [\x21-\x39\x3b-\x5a\x5c\x5e-\x7e]+
SYSLOGPROG %{PROG:program}(?:\[%{NONNEGINT:pid}\])?
SYSLOGHOST %{IPORHOST}
SYSLOGFACILITY <%{NONNEGINT:facility}\.%{NONNEGINT:priority}>

# RFC 3164 section 4.1 header and tag: timestamp, optional <facility.priority>, host, program[pid]:
SYSLOGBASE %{SYSLOGTIMESTAMP:timestamp} (?:%{SYSLOGFACILITY} )?%{SYSLOGHOST:logsource} %{SYSLOGPROG}: