Nginx-Access日志格式
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Nginx-Access日志格式相关的知识,希望对你有一定的参考价值。
#nginx访问日志的格式,方便使用filebeat通过json的格式收集和推送到logstash解析;
log_format elk ‘{"@timestamp": "$time_iso8601", ‘
‘"request_id": "$request_id", ‘
‘"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_host": "$http_host", ‘
‘"http_referrer": "$http_referer", ‘
‘"http_user_agent": "$http_user_agent", ‘
‘"upstream_addr": "$upstream_addr", ‘
‘"upstream_status": "$upstream_status", ‘
‘"upstream_response_time": "$upstream_response_time", ‘
‘"X-Forwarded-For": "$http_x_forwarded_for"}‘;
以上是关于Nginx-Access日志格式的主要内容,如果未能解决你的问题,请参考以下文章