Last active
April 26, 2023 16:17
-
-
Save dragolabs/78f3e677fe87bbcf0452 to your computer and use it in GitHub Desktop.
Nginx log format and grok pattern for default (combined) and custom format
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| log_format custom '$remote_addr - $remote_user [$time_local] ' | |
| '"$request" $status $bytes_sent ' | |
| '"$http_referer" "$http_user_agent" ' | |
| '"$host" "$uri" "$args" "$sent_http_location" ' | |
| '"$proxy_host" "$upstream_addr" "$upstream_cache_status" ' | |
| '[$request_time] [$upstream_response_time]'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| NGINXACCESS %{IPORHOST:remote_addr} - %{USERNAME:remote_user} \[%{HTTPDATE:time_local}\] \"%{DATA:request}\" %{INT:status} %{NUMBER:bytes_sent} \"%{DATA:http_referer}\" \"%{DATA:http_user_agent}\"(?: \"%{DATA:http_host}\")?(?: \"%{DATA:uri}\")?(?: \"%{DATA:args}\")?(?: \"%{DATA:redirect_to}\")?(?: \"%{DATA:proxy_pass}\")?(?: \"%{DATA:upstream_addr}\")?(?: \"%{DATA:upstream_cache_status}\")?(?: \[%{DATA:request_time}\])?(?: \[%{DATA:upstream_request_time}\])? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment