First of all thanks a lot for this awesome tool and all the effort you put into it. I recently had the case when I had to ingest a large EVTX file and as you suggested it is faster if you use an XML file instead. To do that, I used the following code to create the XML file:
logontracer finally accepted it as XML file and started trying to parse it but failed with the following error:
ValueError: time data '2021-03-1721:45:05' does not match format '%Y-%m-%dT%H:%M:%S'
As you might notice, logontracer correctly extracted the timestamp correctly but the regular expression in convert_logtime removed the "T" without replacing it with a whitespace:
which leads to 2021-03-17T21:45:05.893954400Z becoming 2021-03-1721:45:05 (see https://regex101.com/r/9on8Ec/1 for the example) and the timestamp cannot be parsed correctly by the next code in convert_logtime:
Matches in Regular expression are replaced with a whitespace which results in '2021-03-17 19:45:05' which can be parsed perfectly and logontracer is able to ingest events.
First of all thanks a lot for this awesome tool and all the effort you put into it. I recently had the case when I had to ingest a large EVTX file and as you suggested it is faster if you use an XML file instead. To do that, I used the following code to create the XML file:
After manually adding the line
<?xml version="1.0" encoding="UTF-8"?>
logontracer finally accepted it as XML file and started trying to parse it but failed with the following error:
ValueError: time data '2021-03-1721:45:05' does not match format '%Y-%m-%dT%H:%M:%S'
As you might notice, logontracer correctly extracted the timestamp correctly but the regular expression in
convert_logtime
removed the "T" without replacing it with a whitespace:tzless = re.sub('[^0-9-:\s]', '', logtime.split(".")[0]).strip()
which leads to
2021-03-17T21:45:05.893954400Z
becoming2021-03-1721:45:05
(see https://regex101.com/r/9on8Ec/1 for the example) and the timestamp cannot be parsed correctly by the next code inconvert_logtime
:FIX:
Matches in Regular expression are replaced with a whitespace which results in '2021-03-17 19:45:05' which can be parsed perfectly and logontracer is able to ingest events.
Hope that helps!