Skip to content

Instantly share code, notes, and snippets.

@edvakf
Last active April 30, 2016 00:00
Show Gist options
  • Save edvakf/a56075ce9110231d903780814bb00172 to your computer and use it in GitHub Desktop.
Save edvakf/a56075ce9110231d903780814bb00172 to your computer and use it in GitHub Desktop.
# /etc/nginx/nginx.conf
http {
# http://www.xmisao.com/2014/05/09/fluentd-elasticsearch-nginx-log.html
log_format ltsv 'time:$time_iso8601\t'
'remote_addr:$remote_addr\t'
'request_method:$request_method\t'
'request_length:$request_length\t'
'request_uri:$request_uri\t'
'https:$https\t'
'uri:$uri\t'
'query_string:$query_string\t'
'status:$status\t'
'bytes_sent:$bytes_sent\t'
'body_bytes_sent:$body_bytes_sent\t'
'referer:$http_referer\t'
'useragent:$http_user_agent\t'
'forwardedfor:$http_x_forwarded_for\t'
'request_time:$request_time\t'
'upstream_response_time:$upstream_response_time\t'
'host:$host';
# 既にあるこの行の一番後ろにltsvと追加
access_log /var/log/nginx/access.log ltsv;
...
}
@edvakf
Copy link
Author

edvakf commented Apr 27, 2016

反映するときは

sudo nginx -t && sudo systemctl reload nginx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment