Filter Event Logs from the CLI with wevtutil
Query the System or Application log for errors, newest first, without opening Event Viewer.
01Command
$ wevtutil qe System /q:"*[System[(Level=2)]]" /c:20 /rd:true /f:text02What it does
wevtutil qe queries event channels with an XPath filter; Level=2 means Error events, and /rd:true lists newest first. Change the channel name to Application or Security, or replace Level with (Level=1 or Level=2) to include Critical. The syntax is easy to forget because XPath filters are quoted and case-sensitive inside the brackets.
03Risk
04Undo
✓No undo needed — this command does not change persistent state.
05Sources
- wevtutil - Windows CommandsEvidence: Documents wevtutil, including the query-events (qe) command with /q XPath filter, /c count, /rd reverse direction and /f text format.
Last verified: 2026-09-17 · Category: System & Settings
06Related solutions
One command that shows OS version, install date, boot time, memory, network adapters and installed hotfixes.
Built-in command that enumerates kernel drivers with state, start mode and file path.
Use the System File Checker to verify every protected Windows system file against known-good copies and automatically replace the damaged ones.