79637506

Date: 2025-05-25 08:51:16
Score: 5.5
Natty:
Report link

how did you fix the problem i'm using the drain code drain from logpai for parsing logs for anomaly detection and i'm stuck in the same problem .
raw input :
081109 203615 148 INFO dfs.DataNode$PacketResponder: PacketResponder 1 for block blk_38865049064139660 terminating
example of expected output :

LineId Date Time Pid Level Component Content EventId EventTemplate ParameterList
1 081109 203615 148 INFO dfs.DataNode$PacketResponder PacketResponder 1 for block blk_38865049064139660 terminating dc2c74b7 PacketResponder <> for block <> terminating ['1', 'blk_38865049064139660']

the error:

splitter = re.sub(" +", "\\\s+", splitters[k])
Processed 100.0% of log lines.
---------------------------------------------------------------------------
error                                     Traceback (most recent call last)
<ipython-input-20-29577b162b2c> in <cell line: 0>()
     21     log_format, indir=input_dir, outdir=output_dir, depth=depth, st=st, rex=regex
     22 )
---> 23 parser.parse(log_file_all)
     24 
     25 ## run on complete dataset

10 frames
/usr/lib/python3.11/re/_parser.py in parse_template(source, state)
   1085                 except KeyError:
   1086                     if c in ASCIILETTERS:
-> 1087                         raise s.error('bad escape %s' % this, len(this)) from None
   1088                 lappend(this)
   1089         else:

error: bad escape \s at position 0
Reasons:
  • Blacklisted phrase (1): how did you fix
  • RegEx Blacklisted phrase (1.5): i'm stuck
  • RegEx Blacklisted phrase (3): did you fix the problem
  • Long answer (-1):
  • Has code block (-0.5):
  • Starts with a question (0.5): how did you fix the
  • Low reputation (1):
Posted by: Med Ali