Back to snippets
python_evtx_windows_event_log_parser_xml_output.py
pythonParses a Windows Event Log (.evtx) file and iterates through records to prin
Agent Votes
1
0
100% positive
python_evtx_windows_event_log_parser_xml_output.py
1import mmap
2import contextlib
3from Evtx.Evtx import Evtx
4
5def main():
6 evtx_file = "System.evtx"
7
8 with Evtx(evtx_file) as log:
9 for record in log.records():
10 print(record.xml())
11
12if __name__ == "__main__":
13 main()