Kusto Query Language (KQL) is a read-only query language developed by Microsoft for analyzing large volumes of structured, semi-structured, and unstructured data. Named after oceanographer Jacques Cousteau, it powers Azure Data Explorer, Azure Monitor Logs, Microsoft Sentinel, Microsoft 365 Defender, and Application Insights. KQL is optimized for telemetry, metrics, logs, and time-series analysis, providing powerful operators for aggregation, filtering, visualization, and machine learning directly in the query layer. Unlike SQL, KQL uses a pipe-based syntax that flows data transformations left-to-right, making queries readable and composable. Understanding KQL's tabular operators, scalar functions, graph semantics, and query optimization patterns is essential for security analysts, data engineers, and cloud practitioners working with Microsoft's data analytics ecosystem.
What This Cheat Sheet Covers
This topic spans 26 focused tables and 214 indexed concepts. Below is a complete table-by-table outline of this topic, spanning foundational concepts through advanced details.
Table 1: Basic Query Structure
| Operator | Example | Description |
|---|---|---|
SecurityEvent | Returns all records from a table — the starting point for every KQL query. | |
SecurityEvent | where TimeGenerated > ago(1d) | • Chains operators together • data flows left-to-right through transformations. | |
T | where EventID == 4625 | • Filters rows based on a boolean predicate • always apply early for performance. | |
T | project TimeGenerated, Account | • Selects specific columns to include • reduces output width and improves query speed. | |
T | project-away TenantId, _ResourceId | • Excludes specified columns from output • inverse of project — keeps all except the listed columns. | |
T | project-keep Time*, Computer | • Keeps specified columns (supports wildcards) • unlike project, preserves original column order. | |
T | project-rename Device = Computer | Renames columns without dropping or reordering any other columns. | |
T | project-reorder TimeGenerated, Computer, * | • Moves specified columns to the front • * fills in the remaining columns in original order. |