From 76319574204699df190a4fd6b0da0a4950932cbb Mon Sep 17 00:00:00 2001 From: yangchao-g Date: Thu, 31 Mar 2016 16:25:50 +0800 Subject: [PATCH] use non-greedy regex to match a log --- ngxtop/config_parser.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ngxtop/config_parser.py b/ngxtop/config_parser.py index 0d9f00a..e84a07c 100644 --- a/ngxtop/config_parser.py +++ b/ngxtop/config_parser.py @@ -133,7 +133,7 @@ def build_pattern(log_format): elif log_format == 'common': log_format = LOG_FORMAT_COMMON pattern = re.sub(REGEX_SPECIAL_CHARS, r'\\\1', log_format) - pattern = re.sub(REGEX_LOG_FORMAT_VARIABLE, '(?P<\\1>.*)', pattern) + pattern = re.sub(REGEX_LOG_FORMAT_VARIABLE, '(?P<\\1>.*?)', pattern) return re.compile(pattern)