阿里nginx access日志配置
配置名称:nginx_sys_access_log_config
日志主题类型->文件路径提取->^\/var\/log\/nginx\/(.*?)\/access.*.log$ A:提取topic的规则:用()包裹的值做为topic。记得先给__topic__加个索引
文件路径:/var/log/nginx/ access.*.log
最大目录监控深度: 2层
日志样例:
123.168.78.91 - - [14/May/2024:08:34:10 +0800] "POST /api/delivery/accountlogin?username=jiaofuceshi1&password=123456&device_token=AtdGKtgtYnZoKoOQKX9n_pIN-5bjpMoPDbpveGi-ufE2 HTTP/1.1" 200 282 "-" "okhttp/3.10.0" "-"
123.168.78.91 - - [14/May/2024:08:34:11 +0800] "GET /api/delivery/index?token=3d3cc33dfece22824c15caff7ad88bf3 HTTP/1.1" 200 5097 "-" "okhttp/3.10.0" "-"
多行模式:开启
行首正则表达式:\d+\.\d+\.\d+\.\d+\s-\s.*
切分失败处理方式:保留单行
处理插件:NGINX模式解析
NGINX日志配置:
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $request_length '
'$request_time $body_bytes_sent "$http_referer" '
'"$http_user_agent"';