web_log: remove trailing space from nginx_ext2 pattern (#6138)
* remove trailing space from nginx_ext2 pattern * handle " in resp_upstream_time * update module config
Ilya Mashchenko committed
May 28, 2019 at 12:21 UTC
cac85261176150567c13e0719dbaaaef5127a908
2 files changed
+3
-4
collectors/python.d.plugin/web_log/web_log.chart.py
+2
-3
@@ -4,9 +4,8 @@
4
# SPDX-License-Identifier: GPL-3.0-or-later
5
6
import bisect
7
-import re
7
import os
9
-
8
+import re
9
from collections import namedtuple, defaultdict
10
from copy import deepcopy
11
@@ -660,7 +659,7 @@ class Web:
659
r' (?P<bytes_sent>\d+)'
660
r' (?P<resp_length>\d+)'
661
r' (?P<resp_time>\d+\.\d+)'
663
- r' (?P<resp_time_upstream>[\d.-]+) ')
662
+ r' "?(?P<resp_time_upstream>[\d.-]+)')
663
664
nginx_ext_append = re.compile(r'(?P<address>[\da-f.:]+)'
665
r' -.*?"(?P<request>[^"]*)"'
collectors/python.d.plugin/web_log/web_log.conf
+1
-1
@@ -97,7 +97,7 @@
97
# nginx:
98
# log_format netdata '$remote_addr - $remote_user [$time_local] '
99
# '"$request" $status $body_bytes_sent '
100
-# '$request_length $request_time $upstream_response_time '
100
+# '$request_length $request_time "$upstream_response_time" '
101
# '"$http_referer" "$http_user_agent"';
102
# access_log /var/log/nginx/access.log netdata;
103
#