{"id":27171238,"url":"https://github.com/forderud/windowseventquery","last_synced_at":"2025-04-09T08:32:23.717Z","repository":{"id":285831701,"uuid":"959412586","full_name":"forderud/WindowsEventQuery","owner":"forderud","description":"Sample code for querying the Windows event logs","archived":false,"fork":false,"pushed_at":"2025-04-02T22:43:41.000Z","size":53,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-02T23:19:21.692Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/forderud.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-04-02T18:41:08.000Z","updated_at":"2025-04-02T22:43:45.000Z","dependencies_parsed_at":"2025-04-02T23:19:35.553Z","dependency_job_id":"07aa5926-dc00-486e-9591-1d4593749796","html_url":"https://github.com/forderud/WindowsEventQuery","commit_stats":null,"previous_names":["forderud/windowseventquery"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/forderud%2FWindowsEventQuery","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/forderud%2FWindowsEventQuery/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/forderud%2FWindowsEventQuery/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/forderud%2FWindowsEventQuery/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/forderud","download_url":"https://codeload.github.com/forderud/WindowsEventQuery/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248002982,"owners_count":21031711,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-04-09T08:30:59.938Z","updated_at":"2025-04-09T08:32:23.697Z","avatar_url":"https://github.com/forderud.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"Sample code for **querying the Windows event logs**. Based on Microsoft's [Consuming Events (Windows Event Log)](https://learn.microsoft.com/en-us/windows/win32/wes/consuming-events) article.\n\n## WindowsEventQuery tool\nCommand-line C++ application that demonstrates how to query the Windows event log APIs with XPath queries. Has a command-line interface resembling `wevtutil`.\n\n\n## wevtutil tool\n[wevtutil](https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/wevtutil) can be used to query the Windows Event log from the command-line.\n\nExample queries:\n* Last 5 critical or error events from the \"System\" log: `wevtutil qe \"System\" /q:\"*[System/Level\u003c=2]\" /c:5 /rd:true /f:text`\n* All events with warning or higher severity from \"Application\" log the last 24 hours: `wevtutil qe \"Application\" /q:\"*[System[(Level\u003e=1) and (Level\u003c=3) and TimeCreated[timediff(@SystemTime) \u003c= 86400000]]]\" /f:text`\n\n`/rd:true` means events are displayed from newest to oldest, and `/f:text` displays them as text instead of XML. 86400000 is the number of milliseconds in 24 hours.\n\nEvent severity level values: Critical (`System/Level=1`), Error (`System/Level=2`), Warning (`System/Level=3`), Information (`System/Level=4`).\n\nNOTICE: `System/Level=0` information events have been observed in the \"Application\" log.\n\n## Examples of logged events\nSome examples of system problems automatically logged by Windows. All of these events can also be accessed through the Windows Event Log APIs.\n\n### Disk failures\nDisk and filesystem problems are automaticaly logged:  \n![image](https://github.com/user-attachments/assets/b148863a-3d67-4b81-a64f-4bb66384e136)  \n![image](https://github.com/user-attachments/assets/8011024f-be1d-4dd7-8a46-c9b9023a25ec)\n\n### HW device failures\nHW device failures are automatically logged:  \n![image](https://github.com/user-attachments/assets/723867a3-6bb5-4405-8719-967240e72781)  \n![image](https://github.com/user-attachments/assets/9a095ccd-cccd-4e7a-84af-93c47936adb9)\n\n### GPU problems\nGPU watchdog recovery:  \n![image](https://github.com/user-attachments/assets/ef34e983-696f-4397-9d4c-0d1f1ec73d2c)\n\nHigh GPU resource usage:  \n![image](https://github.com/user-attachments/assets/ea8aaa33-fb50-4640-8506-5c7f01570471)\n\n### Firewall logs\nLogging of dropped packets by the firewall: (logging _not_ enabled by default)  \n![image](https://github.com/user-attachments/assets/4c01cd9f-2a6b-4963-9d30-c2a2b776a5c7)\n\n### Application whitelising (WDAC) problems\nApplications not starting due to insufficient whitelisting:  \n![image](https://github.com/user-attachments/assets/c034b43e-fb26-470a-903b-e1c37dc1fef9)\n\n### Background service problems\n![image](https://github.com/user-attachments/assets/75f05ab9-e45a-494f-9471-5d9f3a775eb0)\n\n### Application hang or crash\n![image](https://github.com/user-attachments/assets/4f5a6796-943e-4948-be40-1f8c4ff30af4)\n\n### Critical OS failure\nReason for unexpected system reboots:  \n![image](https://github.com/user-attachments/assets/0164914d-c894-4347-904b-bfa60e65bda7)\n\n\n### SW installation results\nInstallation failure:  \n![image](https://github.com/user-attachments/assets/5f780f94-44a5-4e63-b27b-bff437054709)  \n\nInstallation success:  \n![image](https://github.com/user-attachments/assets/275f6497-32fa-44e4-a4b8-dafa4816c468)  \n\nNeed to restart afterwards:  \n![image](https://github.com/user-attachments/assets/f20751a9-7e54-47c6-9978-6f70d2db4010)  \n\nEvent ID code doc: [Windows Installer Event Logging](https://learn.microsoft.com/en-us/windows/win32/msi/event-logging)\n\n## Documentation\n* ~~[Event Logging](https://learn.microsoft.com/en-us/windows/win32/eventlog/event-logging)~~ (old APIs)\n* [Windows Event Log](https://learn.microsoft.com/en-us/windows/win32/wes/windows-event-log) (new APIs)\n* Windows [Event type schema](https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-even6/8c61aef7-bd4b-4edb-8dfd-3c9a7537886b)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fforderud%2Fwindowseventquery","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fforderud%2Fwindowseventquery","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fforderud%2Fwindowseventquery/lists"}