A user explicitly initiated an interactive logoff. Precedes 4634 for interactive sessions.
Minimal threat relevance. Absence for a long-running interactive session may indicate a session left open for persistence.
Use to build session timelines. No standalone alerting.
SubjectUserNameTargetUserNameLogonTypeIpAddressWorkstationName Starting points — adapt the log source, projected fields and thresholds for your environment.
SecurityEvent
| where EventID == 4647 // User initiated logoff
| project TimeGenerated, Computer, SubjectUserName, TargetUserName, LogonType, IpAddress, WorkstationName
| sort by TimeGenerated desc
index=* sourcetype="WinEventLog:Security" EventCode=4647
| stats count earliest(_time) as first_seen latest(_time) as last_seen by ComputerName
| sort - count `# User initiated logoff — add EventData fields: SubjectUserName, TargetUserName, LogonType, IpAddress`
User initiated logoff. A user explicitly initiated an interactive logoff. Precedes 4634 for interactive sessions.
Event 4647 is written to the Security channel by Microsoft-Windows-Security-Auditing. Advanced Audit Policy — enable the 'Logon/Logoff' subcategory (Success and/or Failure).
Use to build session timelines. No standalone alerting.