logpai/logparser

running python Drain_demo.py , An error occurred

superfeimao opened this issue · 0 comments

(base) ➜ demo git:(master) ✗ python Drain_demo.py
Parsing file: ../logs/HDFS/HDFS_2k.log
Processed 50.0% of log lines.
Processed 100.0% of log lines.
Traceback (most recent call last):
File "/environment/miniconda3/lib/python3.8/sre_parse.py", line 1039, in parse_template
this = chr(ESCAPES[this][1])
KeyError: '\s'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "Drain_demo.py", line 20, in
parser.parse(log_file)
File "/home/featurize/logparser/logparser/demo/../logparser/Drain/Drain.py", line 285, in parse
self.outputResult(logCluL)
File "/home/featurize/logparser/logparser/demo/../logparser/Drain/Drain.py", line 216, in outputResult
self.df_log["ParameterList"] = self.df_log.apply(self.get_parameter_list, axis=1)
File "/environment/miniconda3/lib/python3.8/site-packages/pandas/core/frame.py", line 9568, in apply
return op.apply().finalize(self, method="apply")
File "/environment/miniconda3/lib/python3.8/site-packages/pandas/core/apply.py", line 764, in apply
return self.apply_standard()
File "/environment/miniconda3/lib/python3.8/site-packages/pandas/core/apply.py", line 891, in apply_standard
results, res_index = self.apply_series_generator()
File "/environment/miniconda3/lib/python3.8/site-packages/pandas/core/apply.py", line 907, in apply_series_generator
results[i] = self.f(v)
File "/home/featurize/logparser/logparser/demo/../logparser/Drain/Drain.py", line 339, in get_parameter_list
template_regex = re.sub(r'\ +', r'\s+', template_regex)
File "/environment/miniconda3/lib/python3.8/re.py", line 210, in sub
return _compile(pattern, flags).sub(repl, string, count)
File "/environment/miniconda3/lib/python3.8/re.py", line 327, in _subx
template = _compile_repl(template, pattern)
File "/environment/miniconda3/lib/python3.8/re.py", line 318, in _compile_repl
return sre_parse.parse_template(repl, pattern)
File "/environment/miniconda3/lib/python3.8/sre_parse.py", line 1042, in parse_template
raise s.error('bad escape %s' % this, len(this))
re.error: bad escape \s at position 0