本文共 697 字,大约阅读时间需要 2 分钟。
#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"}';转载于:https://blog.51cto.com/agent/2314496