logfile JSON format
log_format backend_json '{proxy:\'$remote_addr\', 'logfile CSV fornnat
'remote_addr:\'$http_x_forwarded_for\',http_user:\'$remote_user\', '
'request_timestamp: \'$time_iso8601\',request:\'$request\',status:\'$status\','
'request_size:\'$body_bytes_sent\',referer:\'$http_referer\','
'user_agent:\'$http_user_agent\'}';
log_format csv2
'"$remote_addr",'
'"$http_x_forwarded_for",'
'$status,'
'$request_time,'
'"$http_host",'
'"$server_addr",'
'"$scheme",'
'"$time_iso8601",'
'$bytes_sent,'
'"$request",'
'"$http_referer",'
'"$http_user_agent"';
Использование:
access_log /var/log/nginx/site-access.log csv2;
Комментариев нет:
Отправить комментарий