Advanced hunting uses KQL to query up to 30 days of raw Defender XDR data across Endpoint, Office 365, Cloud Apps, and Identity. Event data arrives near real time; entity data refreshes incrementally and consolidates daily. Timestamps are UTC.
- Learn schema families:
Device*, Email*, Identity*, CloudAppEvents, AlertInfo, and AlertEvidence. - Custom detection queries must return
Timestamp, DeviceId, and ReportId for device-based actions. - Rules can run every 24/12/3/1 hours or continuously (NRT), create alerts, and act on devices or files.
- Hunting graph visualizes nodes and relationships for lateral movement and exposure analysis.
DeviceEvents
| where Timestamp > ago(7d)
| where ActionType == "AntivirusDetection"
| summarize (Timestamp, ReportId)=arg_max(Timestamp, ReportId), count() by DeviceId
| where count_ > 5
Exam takeaway: choose the correct table, preserve required event identifiers, tune results, then configure frequency, entities, actions, and scope.
Official lessonKQL, custom detections, and Hunting graph