web_log plugin: replace re.findall with re.search in get_data
Ilya committed
Feb 10, 2017 at 10:45 UTC
cdaea61f1f12a764ca94324bbdedbcbfefb8871c
1 file changed
+2
-2
python.d/web_log.chart.py
+2
-2
@@ -268,9 +268,9 @@ class Service(LogService):
268
default_dict = defaultdict(lambda: 0)
269
270
for line in raw:
271
- match = self.regex.findall(line)
271
+ match = self.regex.search(line)
272
if match:
273
- match_dict = dict(zip_longest('address method url code sent resp_length resp_time'.split(), match[0]))
273
+ match_dict = dict(zip_longest('address method url code sent resp_length resp_time'.split(), match.groups()))
274
try:
275
code = ''.join([match_dict['code'][0], 'xx'])
276
to_netdata[code] += 1