grippo 0.1.1

Parse, match and scrub data at scale.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
# S3 server access log Request-URI: `METHOD /bucket/key?query HTTP/1.1`.
S3_REQUEST_LINE (?:%{WORD:verb} %{NOTSPACE:request}(?: HTTP/%{NUMBER:httpversion})?|%{DATA:rawrequest})
# S3 server access log: owner, bucket, [time], remote IP, requester, request id, operation, key, "request", status, error code, bytes, object size, total and turn-around time, "referer", "user-agent", version id, then host id, signature version, cipher suite, authentication type, host header, TLS version, access point ARN and aclRequired on current logs.
S3_ACCESS_LOG %{NOTSPACE:owner} %{NOTSPACE:bucket} \[%{HTTPDATE:timestamp}\] %{IP:clientip} %{NOTSPACE:requester} %{NOTSPACE:request_id} %{NOTSPACE:operation} %{NOTSPACE:key} (?:"%{S3_REQUEST_LINE}"|-) (?:%{INT:response:int}|-) (?:-|%{NOTSPACE:error_code}) (?:%{INT:bytes:int}|-) (?:%{INT:object_size:int}|-) (?:%{INT:request_time_ms:int}|-) (?:%{INT:turnaround_time_ms:int}|-) (?:%{QS:referrer}|-) (?:%{QS:agent}|-) (?:-|%{NOTSPACE:version_id})(?: %{NOTSPACE:host_id} %{NOTSPACE:signature_version} %{NOTSPACE:cipher_suite} %{NOTSPACE:authentication_type} %{NOTSPACE:host_header} %{NOTSPACE:tls_version}(?: %{NOTSPACE:access_point_arn} %{NOTSPACE:acl_required})?)?

# Classic ELB request line: the target is an absolute URI.
ELB_URIPATHPARAM %{URIPATH:path}(?:%{URIPARAM:params})?
ELB_URI %{URIPROTO:proto}://(?:%{USER}(?::[^@]*)?@)?(?:%{URIHOST:urihost})?(?:%{ELB_URIPATHPARAM})?
ELB_REQUEST_LINE (?:%{WORD:verb} %{ELB_URI:request}(?: HTTP/%{NUMBER:httpversion})?|%{DATA:rawrequest})
# Classic ELB access log: time, name, client:port, backend:port or `-`, three processing times (-1 when unavailable), the two status codes, received and sent bytes, "request", "user agent", cipher and protocol.
ELB_ACCESS_LOG %{TIMESTAMP_ISO8601:timestamp} %{NOTSPACE:elb} %{IP:clientip}:%{INT:clientport:int} (?:%{IP:backendip}:%{INT:backendport:int}|-) %{NUMBER:request_processing_time:float} %{NUMBER:backend_processing_time:float} %{NUMBER:response_processing_time:float} %{INT:response:int} (?:-|%{INT:backend_response:int}) %{INT:received_bytes:int} %{INT:bytes:int} "%{ELB_REQUEST_LINE}"(?: "%{DATA:agent}" %{NOTSPACE:ssl_cipher} %{NOTSPACE:ssl_protocol})?

# CloudFront standard log: tab-separated, one cell per field, `-` for an empty one. The last ten cells are present on current logs only.
CLOUDFRONT_ACCESS_LOG (?<timestamp>[0-9]{4}-[0-9]{2}-[0-9]{2}\t[0-9]{2}:[0-9]{2}:[0-9]{2})\t%{NOTSPACE:x_edge_location}\t(?:%{NUMBER:sc_bytes:int}|-)\t%{IPORHOST:clientip}\t%{WORD:cs_method}\t%{NOTSPACE:cs_host}\t%{NOTSPACE:cs_uri_stem}\t%{NUMBER:sc_status:int}\t%{NOTSPACE:referrer}\t%{NOTSPACE:agent}\t%{NOTSPACE:cs_uri_query}\t%{NOTSPACE:cookies}\t%{NOTSPACE:x_edge_result_type}\t%{NOTSPACE:x_edge_request_id}\t%{NOTSPACE:x_host_header}\t%{URIPROTO:cs_protocol}\t%{INT:cs_bytes:int}\t%{NUMBER:time_taken:float}\t%{NOTSPACE:x_forwarded_for}\t%{NOTSPACE:ssl_protocol}\t%{NOTSPACE:ssl_cipher}\t%{NOTSPACE:x_edge_response_result_type}(?:\t%{NOTSPACE:cs_protocol_version}\t%{NOTSPACE:fle_status}\t%{NOTSPACE:fle_encrypted_fields}\t%{NOTSPACE:c_port}\t%{NOTSPACE:time_to_first_byte}\t%{NOTSPACE:x_edge_detailed_result_type}\t%{NOTSPACE:sc_content_type}\t%{NOTSPACE:sc_content_len}\t%{NOTSPACE:sc_range_start}\t%{NOTSPACE:sc_range_end})?