Skip to content

Instantly share code, notes, and snippets.

@edvakf edvakf/nginx ltsv log
Last active Apr 30, 2016

Embed
What would you like to do?
# /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

This comment has been minimized.

Copy link
Owner Author

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
You can’t perform that action at this time.