Windows Event Viewer: event IDs, filters, and central collection
Read Windows event channels and EVTX files, interpret event IDs with their providers and versions, write XPath filters, plan retention, and collect events through WEF or Guance DataKit.
Filtering the Security log to Error events can hide failed sign-ins. Audit failure is a keyword, and an audit event's Level can be 0. The event's channel, provider, ID, and XML need to be read together before deciding what happened.
Windows Event Log is the operating system's structured event-recording system. Event Viewer exposes events written by Windows and applications to channels such as Application, Security, and System, including their severity, source, event ID, timestamp, and XML data. It can also open saved EVTX event files. If you need a Windows log file viewer for an ordinary text .log file, that is a different task; Event Viewer is not a general-purpose text-log reader.
The essentials
- Start with Application, Security, and System. Application and System errors or warnings are useful troubleshooting entry points; Security contains audit records and requires appropriate access.
- Familiar event IDs help, but keep the provider, channel, and event Version with the number. Security audit events 4624/4625, EventLog 6008, Service Control Manager 7000, and Application Error 1000 describe different kinds of evidence.
- Central collection can use Windows Event Forwarding (WEF), or DataKit's Windows event input to send records to Guance for queries and alerts.
Find the right channel
Open eventvwr.msc. The Windows Logs section has five familiar entries:
| Channel | Contents | Typical use |
|---|---|---|
| Application | Events written by applications | Application failures and database errors |
| Security | Audited logons, object access, and privilege use | Security investigations and audit review |
| Setup | Installation and update events | Patch installation history |
| System | Windows components, drivers, and services | Service failures, driver issues, and unexpected shutdowns |
| Forwarded Events | Usually events forwarded from other computers; the channel name is ForwardedEvents |
WEF collection; subscriptions can use another destination channel |
Applications and Services Logs contains product-specific channels, including those for PowerShell, Sysmon, and Windows Defender when present. Go to the relevant channel when investigating a particular component.
Read the event's fields together
An event has a Level, provider/source, event ID, Version, task category, keywords, and XML elements such as EventData or UserData. Standard severity levels include Critical, Error, Warning, Information, and Verbose. Audit Success and Audit Failure are keywords, not severity levels alongside Error. Some Security audit records use Level 0, so an Error-only filter can exclude failed logons.
Use event ID + provider + channel + Version to check the definition and fields. A different provider can reuse the same number, and a newer version of an event can change its schema. Microsoft event levels · Audit keywords
Event IDs worth recognizing
This is a reference to common definitions, not a substitute for the XML on the target Windows version. The Security rows use Microsoft-Windows-Security-Auditing; check the actual event Version before parsing. Event 4624, for example, has multiple versions.
| Event ID | Channel / provider | What it records |
|---|---|---|
| 4624 | Security / Microsoft-Windows-Security-Auditing | A successful logon session: type 2 is interactive, 3 is network, and 10 is remote interactive. Not every record represents a person using a desktop. |
| 4625 | Security / Microsoft-Windows-Security-Auditing | A failed logon. Examine the account, logon type, source, and failure status. |
| 4634/4647 | Security / Microsoft-Windows-Security-Auditing | A logon session ended / a user initiated logoff. |
| 4720/4726 | Security / Microsoft-Windows-Security-Auditing | A user account was created / deleted. |
| 4732/4733 | Security / Microsoft-Windows-Security-Auditing | A member was added to / removed from a security-enabled local group. Check the target group's SID or name before calling it an Administrators-group change. |
| 6005/6006 | System / EventLog | The Event Log service started / stopped. Useful context around startup, not exact equivalents of system power-on/off. |
| 6008 | System / EventLog | The previous shutdown was unexpected. This alone does not establish power loss, a Stop error, or another cause. |
| 41 | System / Microsoft-Windows-Kernel-Power | Windows restarted after an unclean shutdown. Use the BugcheckCode, dumps, and surrounding evidence to investigate. |
| 1000 | Application / Application Error | An application fault. Inspect the application, module, and exception code. |
| 1001 | Application / Windows Error Reporting | A WER report event. Inspect the event name and report content rather than assuming every occurrence is an application crash. Another provider's 1001 has its own definition. |
| 7000/7009/7031 | System / Service Control Manager | A service failed to start / timed out while connecting / terminated unexpectedly. |
4624 logon types and versions · 4732 group changes · Unexpected restart investigation
Filter with custom views and XPath
Filter Current Log supports levels, IDs, and time ranges. Its XML tab supports the Windows Event Log subset of XPath. For example, this expression selects Security audit event 4624 with logon type 10. It finds recorded successful remote-interactive logons, not a complete inventory of RDP activity:
*[System[Provider[@Name='Microsoft-Windows-Security-Auditing'] and EventID=4624] and EventData[Data[@Name='LogonType']='10']]
That is an XPath expression, not an XML document. For the custom-view XML editor, wrap it in a structured query that selects Security explicitly:
<QueryList>
<Query Id="0" Path="Security">
<Select Path="Security">*[System[Provider[@Name='Microsoft-Windows-Security-Auditing'] and EventID=4624] and EventData[Data[@Name='LogonType']='10']]</Select>
</Query>
</QueryList>
Save the query as a custom view to reuse it. Command-line tools include wevtutil and PowerShell's Get-WinEvent. The following PowerShell query is different from the RDP filter: it selects failed logons from the past 24 hours.
# Failed logons from the past 24 hours
Get-WinEvent -FilterHashtable @{LogName='Security'; Id=4625; StartTime=(Get-Date).AddDays(-1)}
wevtutil qe System /q:"*[System[(Level=2)]]" /f:text /c:50
REM Export System events to an existing writable directory
wevtutil epl System C:\backup\system.evtx
Export requires read access to the channel and write access to the destination directory. If that file already exists, choose another name or explicitly decide whether to overwrite it. The qe example returns at most 50 events in its default read direction; it does not inherit the PowerShell query's 24-hour window. These examples follow the documented syntax and were not executed on Windows for this article. XPath and structured queries · Get-WinEvent · wevtutil
Set retention and channel size deliberately
Maximum size and full-log behavior vary with the system, channel, and Group Policy. A universal 20 MB default is not a safe planning assumption. Read the current configuration with wevtutil gl Security.
If a change is needed, an authorized operator can use Group Policy or, after checking the disk budget, wevtutil sl Security /ms:1073741824 to set this example channel's limit to 1 GiB. /ms changes size; it does not configure overwriting or archival. Choose separately whether to overwrite old events, stop accepting new ones when full, or enable automatic backup. Central collection still needs a local buffer sized for event volume and forwarding outages. Events overwritten before they are forwarded cannot be recovered automatically.
Centralize with WEF or direct collection
Windows Event Forwarding (WEF) uses WinRM over WS-Management and supports both source-initiated and collector-initiated subscriptions. Events commonly arrive in ForwardedEvents, but the subscription can choose another destination channel. Domain deployments can use Kerberos authentication and message encryption; HTTPS or client certificates are not required for every configuration. Workgroup and certificate-authenticated designs have their own requirements.
WEF needs no additional third-party Agent on each source, but subscriptions, permissions, and retention still need management. Collected events can feed a search or security-analysis backend; Event Viewer is only one way to inspect them. Microsoft's WEF guidance
Guance's Windows event input provides a direct collection path:
- Install DataKit on Windows and enable
windows_event. Itsxpath_queryQueryList selects channels such as Security, System, and Application and their filters. The DataKit service identity needs read access. - Check the resulting
event_id,event_source,channel,version,level, andkeywordfields. By default,hostnames the DataKit computer;computernames the computer recorded in the original event. Keep that distinction when reading WEF aggregates. - Configure alerts from the data actually received. More than a chosen number of 4625 events in five minutes is an investigation lead, not proof of brute force. Review the account, source, logon type, and failure status. Notifications for 4720 or 6008/41 also need the right provider, channel, change window, and impact context.
- Query across machines. When collecting after WEF, select the actual destination channel, preserve source fields, and check rendered content and service-account access. Do not assume every original event field is automatically mapped to a separate log field.
Common questions
Why is the Security channel empty? Separate missing permission from a filter mismatch, an event that was never audited, or records already overwritten. Channel ACLs, the execution identity, and relevant privileges determine access; local administrators are not the only possible readers. Event Log Readers membership must match the channel's actual authorization. Inspect policy with auditpol /get /category:*, then configure the required success/failure audit categories. Defaults vary between systems.
Can an event ID change between Windows versions? A provider may retain an event's purpose while changing its fields. Event 4624 has different Versions. Keep the provider, channel, Windows version, and event Version when checking definitions or writing a parser.
Should I install Sysmon? Choose it for a defined detection need and maintenance budget. Native Windows auditing can already record some process-creation information. Sysmon adds context such as process GUIDs and hashes in event 1, plus network connections in event 3—but event 3 is disabled by default and needs explicit filtering configuration. Sysmon installs a service and driver; it is optional. To collect it, select the existing Microsoft-Windows-Sysmon/Operational channel and verify DataKit permissions and filters. Sysmon documentation
Should I use WEF or a direct Agent? WEF is worth evaluating where third-party installation is prohibited; a domain often makes centralized configuration easier. Direct DataKit collection requires permission to install and run it. Search and alerting do not require choosing only the direct path: WEF can aggregate events, then an authorized DataKit instance can read the destination channel. In either design, verify that source events are generated, collection or forwarding keeps up, and the backend receives the fields you need.
Continue reading
References: DataKit logging · Log Explorer · Monitoring
Contact us
Join the community
to join the community
Try Guance
Start online and pay only for what you use.
Get startedChoose a Guance plan
