diff --git a/pygrok/pygrok.py b/pygrok/pygrok.py index 26a51c9..2006610 100644 --- a/pygrok/pygrok.py +++ b/pygrok/pygrok.py @@ -51,7 +51,7 @@ def grok_match(text, pattern, custom_patterns = {}, custom_patterns_dir = None): py_regex_pattern = re.sub(r'%{(\w+)}', lambda m: "(" + all_patterns[m.group(1)].regex_str + ")", py_regex_pattern) - if re.search('%{\w+}', py_regex_pattern) is None: + if re.search('%{\w+(:\w+)?}', py_regex_pattern) is None: break match_obj = re.search(py_regex_pattern, text)