Skip to main content

What is KQL (Kusto Query Language)?

KQL is Microsoft's read-only query language for logs and telemetry, used in Microsoft Sentinel, Defender, Azure Monitor, and Azure Data Explorer.

Glossary
Updated 1 min read

Definition

KQL

Also called Kusto Query Language, Kusto

KQL (Kusto Query Language) is Microsoft's read-only query language for exploring logs and telemetry, written as a sequence of operators piped from one to the next, and used in Microsoft Sentinel, Azure Monitor, and Azure Data Explorer.

How it works

Microsoft's overview defines a Kusto query as a read-only request to process data and return results, stated in plain text using a data-flow model. Data is organized in databases, tables, and columns, as in SQL. A query starts from a table and passes rows through operators separated by the pipe character, each one filtering, reshaping, or summarizing what it receives, so operator order affects both results and performance.

Common operators include where, project, summarize, extend, join, sort, and take, plus functions for time series, parsing, and text search. Microsoft notes that KQL is the language for working with data in Microsoft Sentinel, and its tutorial lists Azure Data Explorer, Azure Monitor Log Analytics, and Sentinel as places it runs.

Example

A Sentinel analytics rule that counts failed Entra ID sign-ins per user and IP address over the last hour and keeps only heavy hitters:

SigninLogs
| where TimeGenerated > ago(1h)
| where ResultType != "0"
| summarize FailedSignIns = count() by UserPrincipalName, IPAddress
| where FailedSignIns > 20
| sort by FailedSignIns desc

Why it matters for a SOC

For teams on Microsoft's security stack, KQL is how detections, hunting queries, workbooks, and investigations are written, so fluency in it is a core analyst and detection engineering skill. Its pipeline style is approachable, but it is still a platform-specific language: rules written in KQL don't run elsewhere without translation. Teams that want portability often author in Sigma and convert, and teams moving between platforms face rewriting rules from KQL to SPL or the reverse.

Go deeper

FAQ

Is KQL the same as SQL?
No. KQL organizes data in databases, tables, and columns like SQL, but queries read top to bottom as a pipeline of operators rather than as a single SELECT statement, and KQL queries are read-only.

Sources

  1. Kusto Query Language (KQL) overview | Microsoft Learn · accessed November 16, 2026
  2. Tutorial: Learn common Kusto Query Language operators | Microsoft Learn · accessed November 16, 2026

Attackers are scaling with tokens

Cotool helps defenders operate at machine speed. See how security teams are scaling Detection & Response.

Book a demo