grippo 0.2.1

Parse, match and scrub data faster and more efficiently.
Documentation
# grippo's own definitions, each written from its format's documentation.
# Fields a format leaves out read as "-", so most are NOTSPACE.

# klog and glog: Lmmdd or Lyyyymmdd, then hh:mm:ss.uuuuuu, a space-padded
# thread id, file:line] and the message.
KLOG_LEVEL [IWEF]
KLOG (?<level>[IWEF])(?<month>[0-9]{2})(?<day>[0-9]{2}) %{TIME:time} +%{INT:thread} (?<file>[^\s:]+):%{POSINT:line}\] %{GREEDYDATA:message}
GLOG (?<level>[IWEF])(?<year>[0-9]{4})(?<month>[0-9]{2})(?<day>[0-9]{2}) %{TIME:time} +%{INT:thread} (?<file>[^\s:]+):%{POSINT:line}\] %{GREEDYDATA:message}

# nginx error log: yyyy/mm/dd hh:mm:ss [level] pid#tid: then *connection
# when the line belongs to one.
NGINX_ERROR_LEVEL emerg|alert|crit|error|warn|notice|info|debug
NGINX_ERROR (?<time>[0-9]{4}/[0-9]{2}/[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}) \[(?<level>emerg|alert|crit|error|warn|notice|info|debug)\] %{POSINT:pid}#%{NONNEGINT:tid}: (?:\*%{NONNEGINT:connection} )?%{GREEDYDATA:message}

# ingress-nginx's default upstreaminfo format. An upstream field lists one
# value per upstream tried, joined by ", ".
INGRESS_NGINX_LIST [^ ,]+(?:, [^ ,]+)*
INGRESS_NGINX %{IPORHOST:remote_addr} - %{NOTSPACE:remote_user} \[%{HTTPDATE:time_local}\] "%{DATA:request}" %{INT:status} %{INT:body_bytes_sent} "%{DATA:http_referer}" "%{DATA:http_user_agent}" %{INT:request_length} %{NUMBER:request_time} \[%{DATA:proxy_upstream_name}\] \[%{DATA:proxy_alternative_upstream_name}\] %{INGRESS_NGINX_LIST:upstream_addr} %{INGRESS_NGINX_LIST:upstream_response_length} %{INGRESS_NGINX_LIST:upstream_response_time} %{INGRESS_NGINX_LIST:upstream_status} %{NOTSPACE:req_id}

# VPC flow log, the default version 2 record.
VPC_FLOW_V2 %{INT:version} %{NOTSPACE:account_id} %{NOTSPACE:interface_id} %{NOTSPACE:srcaddr} %{NOTSPACE:dstaddr} %{NOTSPACE:srcport} %{NOTSPACE:dstport} %{NOTSPACE:protocol} %{NOTSPACE:packets} %{NOTSPACE:bytes} %{NOTSPACE:start} %{NOTSPACE:end} (?<action>ACCEPT|REJECT|-) (?<log_status>OK|NODATA|SKIPDATA)

# Application Load Balancer access log, to the error_reason field. Later
# fields are added at the end, so the rest of the line is one field.
ALB_ACCESS_LOG (?<type>https?|h2|grpcs|wss?) %{TIMESTAMP_ISO8601:time} %{NOTSPACE:elb} %{NOTSPACE:client} %{NOTSPACE:target} %{NUMBER:request_processing_time} %{NUMBER:target_processing_time} %{NUMBER:response_processing_time} %{NOTSPACE:elb_status_code} %{NOTSPACE:target_status_code} %{INT:received_bytes} %{INT:sent_bytes} "%{DATA:request}" "%{DATA:user_agent}" %{NOTSPACE:ssl_cipher} %{NOTSPACE:ssl_protocol} %{NOTSPACE:target_group_arn} "%{DATA:trace_id}" "%{DATA:domain_name}" "%{DATA:chosen_cert_arn}" %{NOTSPACE:matched_rule_priority} %{TIMESTAMP_ISO8601:request_creation_time} "%{DATA:actions_executed}" "%{DATA:redirect_url}" "%{DATA:error_reason}"(?: %{GREEDYDATA:rest})?