System Event ID 104: event log cleared
What System Event ID 104 (event log cleared) means, the fields to check, what is normal and what is suspicious, with PowerShell and KQL queries to find it.
System event ID 104 is logged when an event log other than Security is cleared, such as System, Application or PowerShell Operational. Clearing the Security log is 1102. Attackers clear these logs to hide service installs, PowerShell activity and errors.
The fields that matter
| Field | What it tells you |
|---|---|
| Channel | Which log was cleared. |
| SubjectUserName / SubjectDomainName | Who cleared it. |
| Provider | Microsoft-Windows-Eventlog. |
What is normal
Rare. Occasionally admins clear a full Application log on a test machine.
When System Event ID 104 is suspicious
- Any clear on a server or domain controller.
- Several logs cleared within seconds, typically by
wevtutil clin a loop. - A clear near 1102, 7045 or PowerShell activity.
Common false positive: Imaging and sysprep processes clear logs on build machines.
Find System Event ID 104 with PowerShell
Get-WinEvent -FilterHashtable @{LogName='System'; Id=104; StartTime=(Get-Date).AddDays(-7)} -MaxEvents 50 |
ForEach-Object {
$d = [ordered]@{ Time = $_.TimeCreated; Computer = $_.MachineName }
([xml]$_.ToXml()).Event.EventData.Data | ForEach-Object { $d[$_.Name] = $_.'#text' }
[pscustomobject]$d
} | Format-List
Microsoft Sentinel (KQL)
Event
| where TimeGenerated > ago(7d) and EventLog == "System" and EventID == 104
| project TimeGenerated, Computer, RenderedDescription, EventData
| order by TimeGenerated desc
Related events
- Event ID 1102: Security audit log cleared
- Event ID 1100: Event logging service shut down
- System Event ID 7045: New service installed
- PowerShell Event ID 4104: PowerShell script block logged
FAQ
How do I keep logs an attacker can't clear?
Forward them to a SIEM or a Windows Event Forwarding collector as they are written; a local clear then doesn't erase the copy.
Windows Event Triage reads a CSV, EVTX-to-JSON or XML export in your browser and flags brute force, new admins, suspicious services and log clearing.
IOC Triage, our free browser extension: right-click it for a verdict from 15 threat-intel sources, then copy a ready ticket note.