nginx配置json格式日志


   log_format fat-s-k8s   '{"@timestamp":"$time_iso8601",'
                          '"@source":"$server_addr",'
                          '"app":"nginx",'
                          '"hostname":"$hostname",'
                          '"remote_user":"$remote_user",'
                          '"ip":"$http_x_forwarded_for",'
                          '"client":"$remote_addr",'
                          '"request_method":"$request_method",'
                          '"scheme":"$scheme",'
                          '"domain":"$server_name",'
                          '"referer":"$http_referer",'
                          '"request":"$request_uri",'
                          '"requesturl":"$request",'
                          '"args":"$args",'
                          '"size":$body_bytes_sent,'
                          '"status": $status,'
                          '"responsetime":$request_time,'
                          '"upstreamtime":"$upstream_response_time",'
                          '"upstreamaddr":"$upstream_addr",'
                          '"http_user_agent":"$http_user_agent",'
                          '"http_cookie":"$http_cookie",'
                          '"https":"$https"'
                          '}';

引用

access_log  /data/k8s-storage/logs/fat-s-k8s/nginx/nginx-kkcloud-k8s-commsumer.json fat-s-k8s;

 

原创文章,作者:bd101bd101,如若转载,请注明出处:https://blog.ytso.com/tech/aiops/270323.html

(0)
上一篇 2022年6月25日 08:52
下一篇 2022年6月25日 08:52

相关推荐

发表回复

登录后才能评论