Skip to content

Instantly share code, notes, and snippets.

@davidchua
Forked from msiegenthaler/nginx.grok
Created January 31, 2019 07:10
Show Gist options
  • Save davidchua/30ad640994ef4b39483eec8792897da6 to your computer and use it in GitHub Desktop.
Save davidchua/30ad640994ef4b39483eec8792897da6 to your computer and use it in GitHub Desktop.
Grok pattern for nginx ingress in Kubernetes
%{IPORHOST:client_ip} - \[%{IPORHOST:x_forwarded_for}\] - %{DATA:client_identity} \[%{HTTPDATE:timestamp}\] \"(?:%{WORD:verb} %{NOTSPACE:request}(?: HTTP/%{NUMBER:httpversion})?|-)\" %{NUMBER:response} (?:%{NUMBER:bytes_sent;long}|-) (?:"(?:%{URI:referrer}|-)") %{QS:user_agent} %{NUMBER:request_length;long} %{NUMBER:response_time;double} %{DATA:upstream_proxy} %{NUMBER:upstream_bytes_sent;long} %{NUMBER:upstream_response_time} %{NUMBER:upstream_response}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment