Skip to content

Commit

Permalink
Merge pull request #36 from conitrade/hotfix/sysmon-parsing
Browse files Browse the repository at this point in the history
isolate individual line parsing errors
  • Loading branch information
wagga40 committed Sep 1, 2022
2 parents 41369d0 + 89eb123 commit 403ce24
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion zircolite.py
Original file line number Diff line number Diff line change
Expand Up @@ -1071,7 +1071,14 @@ def cleanTag(tag, ns):
if not "Event" in xmlLine:
return None
xmlLine = "<Event>" + xmlLine.split("<Event>")[1]
root = etree.fromstring(xmlLine)

try:
# isolate invidvidual line parsing errors
root = etree.fromstring(xmlLine)
except Exception as ex:
self.logger.debug(f"unable to parse line \"{xmlLine}\": {ex}")
return None

ns = "http://schemas.microsoft.com/win/2004/08/events/event"
child = {"#attributes": {"xmlns": ns}}
for appt in root.getchildren():
Expand Down

0 comments on commit 403ce24

Please sign in to comment.