Skip to content

Instantly share code, notes, and snippets.

@willejs
Created February 12, 2015 18:55
Show Gist options
  • Save willejs/e06e9812d663668fb3fb to your computer and use it in GitHub Desktop.
Save willejs/e06e9812d663668fb3fb to your computer and use it in GitHub Desktop.
log_format logstash_json '{ "@timestamp": "$time_iso8601", '
'"remote_addr": "$remote_addr", '
'"remote_user": "$remote_user", '
'"body_bytes_sent": "$body_bytes_sent", '
'"request_time": "$request_time", '
'"status": "$status", '
'"request": "$request", '
'"request_method": "$request_method", '
'"http_referrer": "$http_referer", '
'"http_cookie": "$http_cookie", '
'"upstream_status": "$upstream_status", '
'"upstream_response_time": "$upstream_response_time", '
'"http_user_agent": "$http_user_agent" }';
access_log /var/log/nginx/access.json logstash_json buffer=32k;
error_log /var/log/nginx/error.log warn;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment