Skip to content

Instantly share code, notes, and snippets.

@burdandrei
Created December 5, 2017 13:23
Show Gist options
  • Save burdandrei/3482a590c3be2c9beabed42efa080a7e to your computer and use it in GitHub Desktop.
Save burdandrei/3482a590c3be2c9beabed42efa080a7e to your computer and use it in GitHub Desktop.
Nginx JSON stype logformat ready to be sent Logstash/Graylog/Splunk
log_format json escape=json
'{ "msec": "$msec", '
'"remote_addr": "$remote_addr", '
'"request_method": "$request_method", '
'"request_uri": "$request_uri", '
'"status": "$status", '
'"body_bytes_sent": "$body_bytes_sent", '
'"http_referer": "$http_referer", '
'"http_user_agent": "$http_user_agent", '
'"request_time": "$request_time" , '
'"http_x_forwarded_for": "$http_x_forwarded_for", '
'"upstream_addr": "$upstream_addr",'
'"upstream_response_time": "$upstream_response_time"}';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment