阿里nginx access日誌配置

配置名稱:nginx_sys_access_log_config

 日誌主題類型->文件路徑提取->^\/var\/log\/nginx\/(.*?)\/access.*.log$

文件路徑:/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"';

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章