Advanced Hunting & KQL
Choosing tables · KQL operators and optimization · threat analytics · hunting graph · blast radius · Sentinel graph
By the tools4free.dev team · Last reviewed November 13, 2026
Practice questions for this topic →
Advanced hunting basics
Advanced hunting is a query-based tool for exploring up to 30 days of raw Defender data. With a Microsoft Sentinel workspace onboarded you can also query analytics-tier data for the retention configured on the workspace. Data comes from Defender for Endpoint, Defender for Office 365, Defender for Cloud Apps, Defender for Identity and Microsoft Sentinel.
| Quota | Value |
|---|---|
| Date range | 30 days for native Defender data |
| Result set | 100,000 rows |
| Timeout | 10 minutes |
| Results size | 64 MB |
| CPU | Warning above 10% of allocated resources; blocked at 100% until the next 15-minute cycle |
- Modes: guided (query builder, for people new to KQL) and advanced (write KQL from scratch).
- Access: Microsoft Entra roles Global Administrator, Security Administrator, Security Reader or Global Reader give full read access to all advanced hunting data. URBAC: Email & collaboration metadata (read) for email tables, Security data basics (read) for the Alerts and behaviors tables. Endpoint data follows Defender for Endpoint RBAC.
- Queries are written in UTC; results are converted to the time zone you set.
- Entity tables (users, devices) are refreshed every hour; event tables arrive almost immediately.
- To keep Defender tables longer than 30 days, onboard a Sentinel workspace and set analytics-tier retention. Data stored only in the Sentinel data lake isn't available in advanced hunting.
- Cross-service operators:
adx()(Azure Data Explorer),arg()(Azure Resource Graph, Sentinel tables only),workspace()(another Log Analytics workspace).adx()andworkspace()aren't supported for custom detections. - The Queries tab lists Shared queries (everyone), My queries (only you) and Community queries (GitHub).
Pick the right table
| Need to find | Table |
|---|---|
| Process creation | DeviceProcessEvents |
| Network connections | DeviceNetworkEvents |
| File creation or modification | DeviceFileEvents |
| Registry changes | DeviceRegistryEvents |
| Device sign-ins and authentication | DeviceLogonEvents |
| DLL loading | DeviceImageLoadEvents |
| Email delivery and blocking | EmailEvents |
| Files attached to email / URLs in email | EmailAttachmentInfo / EmailUrlInfo |
| Post-delivery email actions | EmailPostDeliveryEvents |
| Safe Links clicks | UrlClickEvents |
| AD and Microsoft online service authentication | IdentityLogonEvents |
| Queries for AD objects | IdentityQueryEvents |
| Domain controller events | IdentityDirectoryEvents |
| Entra interactive and non-interactive sign-ins | EntraIdSignInEvents |
| Service principal and managed identity sign-ins | EntraIdSpnSignInEvents |
| Microsoft Graph API requests | GraphAPIAuditEvents |
| Activity in Office 365 and other cloud apps | CloudAppEvents |
| Alerts and the entities in them | AlertInfo / AlertEvidence |
| Installed software and its vulnerabilities | DeviceTvmSoftwareInventory / DeviceTvmSoftwareVulnerabilities |
| Teams messages | MessageEvents |
| Defender for Cloud audit events | CloudAuditEvents |
Some tables are marked Preview on the schema page, such as BehaviorInfo and DisruptionAndResponseEvents. Use the schema reference (View reference next to a table) for columns and ActionType values.
KQL operators and optimization
| Operator | Use |
|---|---|
where | Filter rows by a predicate |
summarize | Aggregate a table |
join | Merge two tables on matching columns |
project | Choose, rename or compute columns |
extend | Add calculated columns |
top / limit | Return the first N rows |
makeset | Dynamic array of distinct values |
find | Match a predicate across tables |
Example shape from Learn: a time filter first, then the process filter, then command-line strings, then project and top.
- Filter early with time and other filters before parsing functions.
- Use
hasinstead ofcontains; scopesearchwithsearch in (...); avoid unscopedsearchandunion. - Parse, don't extract: prefer
parseorparse_json()overextract()andmatches regex. - Project only the columns you need; avoid terms of three characters or fewer.
- Join: smaller table on the left; use
kind=innerbecause the default innerunique join deduplicates the left side; time filters on both sides;hint.shufflekeyfor high-cardinality keys;hint.strategy = broadcastwhen the left table is small (up to 100,000 records). - Use
summarizefor repetitive values; replace it withprojectwhen values are already unique. - Windows reuses process IDs: use
ProcessUniqueIdandInitiatingProcessUniqueIdto link parent and child. - For command lines, match known processes by file name, use case-insensitive operators (
=~,in~), and remove quotes before matching.
| Result view | Notes |
|---|---|
| Table (default) | Export to an Excel workbook |
| Column, pie, line, scatter, area, stacked area, time chart | Export as a JPEG; summarize first, add | render columnchart to force a chart |
Threat analytics
Threat analytics is in-product threat intelligence from Microsoft security researchers, plus OSINT articles. Each report analyzes a tracked threat and uses data from your network to show whether the threat is active and whether protections are in place.
| Dashboard section | Lists |
|---|---|
| Latest threats | Most recently published or updated reports, with active and resolved alerts |
| High-impact threats | Highest number of active and resolved alerts |
| Highest exposure threats | Exposure from vulnerability severity and number of exploitable devices |
| Report tab | What it shows |
|---|---|
| Overview | Summary, impact and exposure charts |
| Analyst report | Attack chains, MITRE mapping, recommendations and hunting guidance |
| Related incidents | Incidents and alerts from Defender for Endpoint, Identity, Office 365, Cloud Apps and Cloud |
| Impacted assets | Devices, users, mailboxes, apps and cloud resources |
| Endpoints exposure | Exposure level and update deployment status |
| Recommended actions | Mitigations tracked in Microsoft Secure Score |
| Indicators (preview) | IOCs, including expired ones; verified customers only |
- A license for at least one Defender product is needed; Defender for Endpoint P1 doesn't grant access. Roles: Security data basics (read) for reports, incidents and impacted assets; Vulnerability management (read) and Exposure Management (read) for exposure data and recommended actions.
- Every report is visible with one supported product, but each product and role is needed to see that product's incidents, assets and actions.
- Threat tags: Ransomware, Phishing, Activity group, Vulnerability. Category filters include Actor and OSINT.
- If a custom detection linked to a report triggers and an alert generates an incident, the report shows up in that incident and the incident appears under the Related incidents tab.
- Misconfigured devices and Vulnerable devices columns show Not available when researchers link no recommended actions or vulnerabilities.
Hunting graph, blast radius and Sentinel graph
The hunting graph renders threat scenarios as interactive graphs of nodes (entities) and edges (relationships). Find it at Investigation & response > Hunting > Advanced hunting with the hunting graph icon, or Create new > Hunting graph. Steps: select a scenario and enter inputs, apply filters, then Run scenario.
| Predefined scenario | Use |
|---|---|
| Attack paths to critical asset | Routes through nodes toward a target (lateral movement) |
| Entity relationship map | Direct connections of one entity |
| Paths between two entities | Is there a path from one entity to another |
| Access to key vaults | Who and what can reach a key vault |
| Potential data exfiltration by device | Storage accounts a device can access |
| Choke points to SQL data stores | Nodes in the most paths to SQL stores |
| Paths to domain admins | Non-privileged users to Domain Admins |
| Kerberoast paths to critical assets | Kerberoast-vulnerable accounts and escalation routes |
- Predefined scenarios are prebuilt advanced hunting queries. Advanced filters can show only the shortest paths; edge direction can be Incoming, Outgoing or Both.
- Access needs an appropriate Microsoft Entra role, Microsoft Sentinel data lake onboarding before September 23, 2026, and at least read-only access in Microsoft Security Exposure Management.
- Blast radius analysis is part of the incident investigation experience. It shows possible propagation paths from a selected node to predefined critical targets, scoped to the user's permissions, and extends and replaces Attack path analysis.
- Open it: select a node in the incident graph, then View blast radius (menu shows No blast radius found if none). The graph shows the eight top-rated attack paths; Hide blast radius returns to the incident graph.
- Prerequisites: onboarded to the Sentinel data lake (before September 23, 2026) and Exposure management (read) or higher.
- Limits: up to seven hops from the source (five for cloud, five for on-premises, three for hybrid); data can lag; paths are possible, not guaranteed; only known attack vectors; only nodes in the viewer's scope.
- Microsoft Sentinel graph models relationships as nodes and edges across security, compliance and identity. It powers the incident graph with blast radius and the hunting graph in Defender, and data risk graphs in Purview. With the data lake, the hunting graph and blast radius are auto provisioned in the Defender portal.
- Custom graphs (preview per Learn) are authored in a Jupyter notebook with the Sentinel extension for Visual Studio Code, published with a graph job, and queried with Graph Query Language (GQL) on the Graphs page. On-demand graph jobs retain a graph for 30 days.
CLI and PowerShell
| Task | Azure CLI | PowerShell |
|---|---|---|
| First hunting query: PowerShell download activity | // Finds PowerShell execution events that could involve a download
union DeviceProcessEvents, DeviceNetworkEvents
| where Timestamp > ago(7d)
// Pivoting on PowerShell processes
| where FileName in~ ("powershell.exe", "powershell_ise.exe")
// Suspicious commands
| where ProcessCommandLine has_any("WebClient",
"DownloadFile",
"DownloadData",
"DownloadString",
"WebRequest",
"Shellcode",
"http",
"https")
| project Timestamp, DeviceName, InitiatingProcessFileName, InitiatingProcessCommandLine,
FileName, ProcessCommandLine, RemoteIP, RemoteUrl, RemotePort, RemoteIPType
| top 100 by Timestamp | - |
| Chart alerts by severity | AlertInfo | summarize Total = count() by Severity | render columnchart | - |
| Inner join on a time-filtered file hash | EmailAttachmentInfo | where Timestamp > ago(1h) | where Subject == "Document Attachment" and FileName == "Document.pdf" | join kind=inner (DeviceFileEvents | where Timestamp > ago(1h)) on SHA256 | - |
| Cross-workspace table | workspace('<Workspace ID or Azure Resource ID>').<Table Name> | - |
Exam Tips
Tick each tip once you can answer it without looking.
“Advanced hunting: how far back for native Defender data” → 30 days. Trap: Longer retention needs a Sentinel workspace with analytics-tier retention.
“Per-query limits in advanced hunting: rows and run time” → 100,000 rows, 10 minutes (64 MB of results).
“Process creation events” → DeviceProcessEvents. Trap: DeviceEvents holds other event types such as antivirus and exploit protection detections.
“Which user clicked a Safe Links URL” → UrlClickEvents.
“On-premises domain controller activity” → IdentityDirectoryEvents. Trap: IdentityLogonEvents covers authentication; IdentityQueryEvents covers AD object queries.
“Entra sign-ins in advanced hunting” → EntraIdSignInEvents (service principals: EntraIdSpnSignInEvents).
“Look for exact text inside words vs speed” → Use has instead of contains. Trap: contains searches substrings and costs more.
“Join keeps only one row per key from the left table” → The default innerunique flavor: use kind=inner.
“Join: which table goes on the left” → The smaller one.
“Unscoped search or union over all tables” → Avoid; use search in (table list).
“Link a parent process to its children on Windows” → ProcessUniqueId and InitiatingProcessUniqueId. Trap: Process IDs are recycled.
“Which Microsoft Defender license doesn't grant threat analytics” → Defender for Endpoint P1.
“Which threat report tab lists IOCs, including expired ones” → Indicators (preview; verified customers).
“Threat analytics: mitigations you can act on and track” → Recommended actions (tracked in Secure Score). Trap: The analyst report can hold more actions that Secure Score doesn't track.
“Show paths from compromised node to critical targets in an incident” → Blast radius (View blast radius on the node). Trap: It extends and replaces Attack path analysis.
“Hunting graph: find nodes in the most paths to SQL stores” → Choke points to SQL data stores scenario.
“Blast radius hop limits” → Seven hops max: five cloud, five on-premises, three hybrid.
Sources
- Advanced hunting overview
- Learn the advanced hunting query language
- Data tables in the advanced hunting schema
- Advanced hunting query best practices
- Work with advanced hunting query results
- Use shared queries
- Use Sentinel functions in advanced hunting
- Threat analytics
- Hunting graph in advanced hunting
- Investigate incidents (blast radius analysis)
- What is Microsoft Sentinel graph?
Checked against Microsoft Learn on November 13, 2026.