diff --git a/logparser/Drain/Drain.py b/logparser/Drain/Drain.py index 258a3b22..0479ffce 100644 --- a/logparser/Drain/Drain.py +++ b/logparser/Drain/Drain.py @@ -336,9 +336,9 @@ def get_parameter_list(self, row): template_regex = re.sub(r"<.{1,5}>", "<*>", row["EventTemplate"]) if "<*>" not in template_regex: return [] template_regex = re.sub(r'([^A-Za-z0-9])', r'\\\1', template_regex) - template_regex = re.sub(r'\\ +', r'\s+', template_regex) + template_regex = re.sub(r'\\ +', r'\\s+', template_regex) template_regex = "^" + template_regex.replace("\<\*\>", "(.*?)") + "$" parameter_list = re.findall(template_regex, row["Content"]) parameter_list = parameter_list[0] if parameter_list else () parameter_list = list(parameter_list) if isinstance(parameter_list, tuple) else [parameter_list] - return parameter_list \ No newline at end of file + return parameter_list