Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update SHISO.py #52

Closed
wants to merge 4 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Replace self.keep_para
For apply function:
If the replaced value does not exist, there would be the error like: Cannot set a frame with no defined index and a value that cannot be converted to a Series
So it can be replaced with if log_templates to check whether it is none
  • Loading branch information
Wapiti08 committed Nov 11, 2019
commit febd117646e8a3e6297dc21202bfc8cb3785b93d
5 changes: 3 additions & 2 deletions logparser/Drain/Drain.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,8 @@ def outputResult(self, logClustL):
self.df_log['EventId'] = log_templateids
self.df_log['EventTemplate'] = log_templates

if self.keep_para:
# if self.keep_para:
if log_templates:
self.df_log["ParameterList"] = self.df_log.apply(self.get_parameter_list, axis=1)
self.df_log.to_csv(os.path.join(self.savePath, self.logName + '_structured.csv'), index=False)

Expand Down Expand Up @@ -341,4 +342,4 @@ def get_parameter_list(self, row):
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
return parameter_list