Skip to content

Instantly share code, notes, and snippets.

@cooniur
Created December 4, 2016 05:03
Show Gist options
  • Select an option

  • Save cooniur/ee71fe6daaf9745afdc4d3932467e91e to your computer and use it in GitHub Desktop.

Select an option

Save cooniur/ee71fe6daaf9745afdc4d3932467e91e to your computer and use it in GitHub Desktop.
Logstash Nginx Pattern
'$http_host '
'$remote_addr [$time_local] '
'"$request" $status $body_bytes_sent '
'"$http_referer" "$http_user_agent" '
'$request_time '
'$upstream_response_time'
www.myapp.com
10.10.10.10 [06/Jun/2015:19:03:26 +0000]
"GET /gateway/api/feed/home?page=0 HTTP/1.1" 200 14732
"-" "MyApp/915 CFNetwork/711.1.12 Darwin/14.0.0"
0.225
0
NGINXACCESS %{IPORHOST:http_host} %{IPORHOST:clientip} \[%{HTTPDATE:timestamp}\] \"(?:%{WORD:verb} %{NOTSPACE:request}(?: HTTP/%{NUMBER:httpversion})?|%{DATA:rawrequest})\" %{NUMBER:response} (?:%{NUMBER:bytes}|-) %{QS:referrer} %{QS:agent} %{NUMBER:request_time:float} %{NUMBER:upstream_time:float}
NGINXACCESS %{IPORHOST:http_host}%{SPACE}%{IPORHOST:clientip}%{SPACE}\[%{HTTPDATE:timestamp}\]%{SPACE}\"(?:%{WORD:verb}%{SPACE}%{NOTSPACE:request}(?:%{SPACE}HTTP/%{NUMBER:httpversion})?|%{DATA:rawrequest})\"%{SPACE}%{NUMBER:status}%{SPACE}(?:%{NUMBER:body_bytes_sent}|-)%{SPACE}%{QS:http_referrer}%{SPACE}%{QS:http_user_agent}%{SPACE}%{NUMBER:request_time:float}%{SPACE}%{NUMBER:upstream_time:float}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment