-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathlog_formats.conf
14 lines (11 loc) · 1.02 KB
/
log_formats.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
# Nginx default log format
log_format main '$remote_addr - $remote_user [$time_local] "$request" $status $body_bytes_sent "$http_referer" "$http_user_agent" "$http_x_forwarded_for"';
# log client cert details
log_format main_mtls '$remote_addr - [$ssl_client_verify] $ssl_client_serial/$ssl_client_v_start/$ssl_client_v_end/$ssl_client_v_remain/"$ssl_client_s_dn"/"$ssl_client_i_dn" - $remote_user [$time_local] "$request" $status $body_bytes_sent "$http_referer" "$http_user_agent" "$http_x_forwarded_for"';
# Apache default log format
# Also can be used with Telegraf logparser plugin
log_format apache '$host $remote_addr - $remote_user [$time_local] "$request" $status $body_bytes_sent "$http_referer" "$http_user_agent"';
# InfluxDB line protocol format
# This is only an example, you should roll your own
# Taken from https://github.com/wongnai/nginx-telegraf-accesslog-docker/blob/master/nginxrt/response_time
log_format influxdb_test 'nginx,uri="$request_uri",method=$request_method,status=$status rt=$request_time,s=$body_bytes_sent';