Pcornel
Windows

Event Logging

Cheat sheet · https://pcornel.dk/topic.php?topic=3126

Back to the Topic

Answer

Windows Event Logging records structured events from Windows components, services, applications and security auditing. The useful unit is not merely an Event ID: provider, channel, level, timestamp, task/opcode, keywords and event data give the event its meaning.

Remember

  • Treat provider + channel + Event ID + timestamp/context as one evidence tuple.
  • An event proves that a provider reported an observation; it does not automatically prove root cause.
  • Absence of an event can be weak evidence if auditing, channel enablement, retention or collection scope is unknown.
  • Operational/Admin channels often contain more component-specific detail than the classic Application/System logs.
  • Correlate logs with runtime state, configuration and the exact symptom before concluding causation.

First checks

  • Get-WinEvent -LogName System -MaxEvents 50 — recent System events
  • Get-WinEvent -FilterHashtable @{LogName='Application';Level=2;StartTime=(Get-Date).AddHours(-1)} — errors last hour
  • Get-WinEvent -ListLog * | ? RecordCount — logs with entries
  • wevtutil gl <log> — log size and retention

Commands

wevtutil
Windows command-line utility for enumerating event logs/providers, reading log configuration, querying/exporting events…
Get-WinEvent
PowerShell cmdlet for querying Windows Event Log and ETW-style event sources as structured EventLogRecord objects, with…
Get-WinEvent -FilterHashtable @{LogName="System"; Id=<id>}
Query Windows event logs.
Get-WinEvent -FilterHashtable @{LogName='System'; StartTime=(Get-Date).AddHours(-1)}
Structured Windows Event Log query.
Get-WinEvent -FilterHashtable @{LogName="System"; StartTime=(Get-Date).AddHours(-1)}
Reads recent structured Windows event log entries.

Verify in this order

event raised by a provider → written to a channel/log → retained per size policy → read or forwarded

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 reference map

BoundaryMeaningEvidence limit
ChannelContainer/subscription for eventschannel presence does not prove useful auditing
ProviderComponent that emits an eventprovider name does not prove root cause
Event IDProvider-defined event identifierID alone is ambiguous
PayloadStructured event-specific datapayload may describe symptom rather than cause
CorrelationTime/context relationship across evidencecorrelation is not causation

Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=3126

Confirmation

Confirm action

Continue?