python windows event log
-
[Python] win32evtlog 모듈을 이용한 윈도우 이벤트 로그 추출Python/Python for Windows 2018. 5. 20. 01:42
당일 이벤트 로그 출력 import win32evtlog as wevt import datetime today = datetime.datetime.now().date() day_ago = today - datetime.timedelta(days=1) server = 'localhost' logtype = 'Application' hand = wevt.OpenEventLog(server,logtype) flags = wevt.EVENTLOG_BACKWARDS_READ|wevt.EVENTLOG_SEQUENTIAL_READ total = wevt.GetNumberOfEventLogRecords(hand) while True: events = wevt.ReadEventLog(hand, flags,0) if ev..