Windows Event Log
Cheat sheet · https://pcornel.dk/topic.php?topic=3127
Answer
Windows Event Log accepts events from registered providers and stores them in channels backed by EVTX log files or forwarded subscriptions. Applications normally interact through logging APIs rather than writing EVTX files directly.
Remember
- Providers emit events; channels organize and retain them.
- EVTX is the native on-disk event log format, not a generic editable text log.
- Channel configuration controls maximum size, retention/overwrite and whether some logs are enabled.
- Clearing a log destroys local history and itself may generate audit evidence.
- Query tools are views over the same underlying event subsystem, not separate truth sources.
First checks
Get-WinEvent -LogName System -MaxEvents 50— recent System eventsGet-WinEvent -FilterHashtable @{LogName='Application';Level=2;StartTime=(Get-Date).AddHours(-1)}— errors last hourGet-WinEvent -ListLog * | ? RecordCount— logs with entrieswevtutil gl <log>— log size and retention
Verify in this order
providers → channels → .evtx files → queried by Event Viewer/Get-WinEvent
Where it usually breaks
First mismatch in definition/configuration → security context → service/task/process creation → runtime state → output/side effect → event/performance evidence; preserve identity/native error/pre-state before mutation.
Event Logging → Windows Event Log reference map
| Boundary | Meaning | Evidence limit |
|---|---|---|
| Provider | Emits structured events | may write to several channels |
| Channel | Logical event destination | may be disabled or size-limited |
| EVTX | Native event storage file | editing/copying is not normal ingestion |
| Retention | Overwrite/archive behavior | missing old records may be policy |
| Renderer | Turns provider data into message text | message text can depend on local resources |
Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=3127