阿里nginx error日志配置
配置名称:nginx_sys_error_log_config
日志主题类型->文件路径提取->\/var\/log\/nginx\/(.*?)\/error.log A:提取topic的规则:用()包裹的值做为topic。记得先给__topic__加个索引
文件路径:/var/log/nginx/ error.log
最大目录监控深度: 2层
日志样例:
2024/01/27 01:25:58 [crit] 221214#221214: *29786 open() "/var/log/nginx/zhixiaoer_zhaopin_test/access.2024-01-27.log" failed (13: Permission denied) while logging request, client: 219.82.2.110, server: zhaopinapit.chinalao.com, request: "GET / HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "zhaopinapit.chinalao.com"
2024/01/27 01:25:58 [crit] 221214#221214: *29786 open() "/var/log/nginx/zhixiaoer_zhaopin_test/access.2024-01-27.log" failed (13: Permission denied) while logging request, client: 219.82.2.110, server: zhaopinapit.chinalao.com, request: "GET / HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "zhaopinapit.chinalao.com"
多行模式:开启
行首正则表达式:\d+/\d+/\d+\s\d+:\d+:\d+\s.*
切分失败处理方式:保留单行