Nginx日志处理为JSON格式,并放置在http区块:

 1  log_format  json  '{"@timestamp":"$time_iso8601",'
 2                       '"@version":"1",'
 3                       '"client":"$remote_addr",'
 4                       '"url":"$uri",'
 5                       '"status":"$status",'
 6                       '"domain":"$host",'
 7                       '"host":"$server_addr",'
 8                       '"size":"$body_bytes_sent",'
 9                       '"responsentime":"$request_time",'
10                       '"referer":"$http_referer",'
11                       '"useragent":"$http_user_agent"'
12                        '}';
13 access_log  logs/access_json.log  json;
Nginx日志格式

相关文章:

  • 2021-08-21
  • 2018-07-15
  • 2021-08-05
  • 2022-12-23
  • 2018-01-15
  • 2021-08-27
  • 2022-01-16
  • 2021-06-18
猜你喜欢
  • 2022-12-23
  • 2021-08-04
  • 2021-10-11
  • 2021-08-29
  • 2022-12-23
  • 2022-01-10
  • 2021-09-05
相关资源
相似解决方案