Skip to content

Instantly share code, notes, and snippets.

@IMBlues
Last active March 17, 2021 09:58
Show Gist options
  • Save IMBlues/c6dd0fb2f22d098207626c1608765bc6 to your computer and use it in GitHub Desktop.
Save IMBlues/c6dd0fb2f22d098207626c1608765bc6 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:request_timestamp}\] \"(?:%{WORD:method} %{NOTSPACE:path}(?: HTTP/%{NUMBER:http_version})?|-)\" %{NUMBER:status_code:int} (?:%{NUMBER:bytes_sent:float}|-) (?:\"(?:%{URI:referrer}|-)\") %{QS:user_agent} %{NUMBER:request_length:int} %{NUMBER:response_time:float} \[%{DATA:upstream_proxy}\] %{DATA:upstream_endpoint} %{NUMBER:upstream_bytes_sent:int} (-|%{NUMBER:upstream_response_time:float}) (-|%{NUMBER:upstream_response:int})"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment