logpai / logparser

A machine learning toolkit for log parsing [ICSE'19, DSN'16]
Other
1.61k stars 555 forks source link

Fixed CSV writing issue in Brain Algorithm: Added `escapechar` and `quoting` options for datasets with special characters #120

Open jcordon5 opened 2 days ago

jcordon5 commented 2 days ago

Problem:

This PR addresses an issue in the Brain module when writing structured log data to a CSV file. The error encountered is:

Error: need to escape, but no escapechar set

The error occurs when parsing datasets that contain special characters or quotes. By default, pandas.to_csv() does not set an escape character, which leads to a failure when special characters are present in the data.

Solution:

The fix involves explicitly setting the following options when calling to_csv() in generateresult method of LogParser class:

Checklist: