A security operations team uses Microsoft Defender XDR. They want to create a custom detection rule that alerts when a specific process (e.g., wscript.exe) launches from a user's temp directory and then performs a network connection to an external IP. Which advanced hunting query language should they use?
Trap 1: PowerShell
PowerShell is a general-purpose scripting and automation language, not a query language for threat hunting in Defender XDR. It can be used to automate interactions with Microsoft Graph or Defender XDR APIs, but the actual query syntax for advanced hunting and custom detections must be KQL executed within the Defender portal or via API calls. Writing a PowerShell script does not replace the need to compose a KQL query, and PowerShell's cmdlets, loops, and pipeline processing are fundamentally different from the declarative, tabular query semantics of KQL.
Trap 2: Splunk SPL
Splunk SPL is the proprietary Search Processing Language for Splunk's SIEM platform, not for Microsoft Defender XDR. Defender XDR's advanced hunting and custom detections rely exclusively on Kusto Query Language (KQL), which has a fundamentally different syntax and data schema. While Splunk can ingest Defender logs via connectors, that does not make SPL a native query language for Defender XDR, and SPL queries cannot be executed in its advanced hunting interface.
Trap 3: SQL
SQL (Structured Query Language) is the standard for relational database queries, but it is not supported in Microsoft Defender XDR's advanced hunting or custom detections. Although KQL resembles SQL in some functions, KQL uses a distinct, pipeline-based syntax (starting with a table name and using `|` operators) and is built on Azure Data Explorer rather than a traditional relational engine. Recognizing the schema differences is important: Defender XDR's data is organized in a flat, time-stamped structure designed for KQL, so attempting SQL statements such as `SELECT * FROM` will fail without a translator, which Microsoft does not provide.
- A
Kusto Query Language (KQL)
Kusto Query Language (KQL) is the native, read-only query language used in Microsoft Defender XDR's advanced hunting and custom detection rules. It is built on Azure Data Explorer and is optimized for querying large security telemetry datasets across the Microsoft 365 ecosystem. KQL supports operators such as `where`, `summarize`, `join`, and `timechart`, enabling security teams to filter, aggregate, and correlate events efficiently without writing additional code. Because custom detections in Defender XDR are constructed from these KQL queries, it is the only listed language that directly fulfills the security team's goal.
- B
PowerShell
Why wrong: PowerShell is a general-purpose scripting and automation language, not a query language for threat hunting in Defender XDR. It can be used to automate interactions with Microsoft Graph or Defender XDR APIs, but the actual query syntax for advanced hunting and custom detections must be KQL executed within the Defender portal or via API calls. Writing a PowerShell script does not replace the need to compose a KQL query, and PowerShell's cmdlets, loops, and pipeline processing are fundamentally different from the declarative, tabular query semantics of KQL.
- C
Splunk SPL
Why wrong: Splunk SPL is the proprietary Search Processing Language for Splunk's SIEM platform, not for Microsoft Defender XDR. Defender XDR's advanced hunting and custom detections rely exclusively on Kusto Query Language (KQL), which has a fundamentally different syntax and data schema. While Splunk can ingest Defender logs via connectors, that does not make SPL a native query language for Defender XDR, and SPL queries cannot be executed in its advanced hunting interface.
- D
SQL
Why wrong: SQL (Structured Query Language) is the standard for relational database queries, but it is not supported in Microsoft Defender XDR's advanced hunting or custom detections. Although KQL resembles SQL in some functions, KQL uses a distinct, pipeline-based syntax (starting with a table name and using `|` operators) and is built on Azure Data Explorer rather than a traditional relational engine. Recognizing the schema differences is important: Defender XDR's data is organized in a flat, time-stamped structure designed for KQL, so attempting SQL statements such as `SELECT * FROM` will fail without a translator, which Microsoft does not provide.