logpai / logparser

A machine learning toolkit for log parsing [ICSE'19, DSN'16]

Home Page:https://logparser.readthedocs.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

UnicodeDecodeError while parsing the log file

pavansai-k opened this issue · comments

While I am using adb log file, Logparser throwing UnicodeDecodeError. Kindly help me how to resolve it.

UnicodeDecodeErrorTraceback (most recent call last)
<ipython-input-39-37c1bebf74a5> in <module>()
     19 
     20 parser = Drain.LogParser(log_format, indir=input_dir, outdir=output_dir,  depth=depth, st=st, rex=regex)
---> 21 parser.parse(log_file)
/home/jupyter/logparser/demo/logparser/logparser/Drain/Drain.py in parse(self, logName)
    283             os.makedirs(self.savePath)
    284 
--> 285         self.outputResult(logCluL)
    286 
    287         print('Parsing done. [Time taken: {!s}]'.format(datetime.now() - start_time))
/home/jupyter/logparser/demo/logparser/logparser/Drain/Drain.py in outputResult(self, logClustL)
    202             template_str = ' '.join(logClust.logTemplate)
    203             occurrence = len(logClust.logIDL)
--> 204             template_id = hashlib.md5(template_str.encode('utf-8')).hexdigest()[0:8]
    205             for logID in logClust.logIDL:
    206                 logID -= 1
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 71: ordinal not in range(128)

use python2.x