-
-
Save scalp42/4973753b13dd0178d4fc to your computer and use it in GitHub Desktop.
nginx json access log
This file contains 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 json '{' | |
'"host": "lb01", ' | |
'"status": "$status", ' | |
'"scheme": "$scheme", ' | |
'"uri": "$request_uri", ' | |
'"args": "$args", ' | |
'"dest_host": "$http_host", ' | |
'"content_type": "$sent_http_content_type", ' | |
'"protocol": "$server_protocol", ' | |
'"referer": "$http_referer", ' | |
'"user_agent": "$http_user_agent", ' | |
'"client_ip": "$remote_addr", ' | |
'"remote_user": "$remote_user", ' | |
'"body_bytes": "$body_bytes_sent", ' | |
'"upstream_x_runtime": "$upstream_http_x_runtime", ' | |
'"processing_time": "$request_time", ' | |
'"upstream_processing_time": "$upstream_response_time", ' | |
'"method": "$request_method", ' | |
'"request": "$request", ' | |
'"request_id": "$upstream_http_x_request_id", ' | |
'"upstream": "$upstream_addr", ' | |
'"ssl_protocol": "$ssl_protocol", ' | |
'"ssl_cipher": "$ssl_cipher"' | |
'}'; | |
access_log /var/log/nginx/access.json.log json; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment