KQL for Beginners: First Queries for Incident Investigation

KQL — Kusto Query Language — is a query language for reading and analyzing data in products such as Azure Monitor and Microsoft Sentinel. A query usually starts with a table and continues with a pipeline of commands: filtering time and events, selecting or creating fields, summarizing by user or asset, and displaying the relevant results for investigation. The key to learning is to start with one question and build the query step by step.
A SOC analyst doesn't need to memorize hundreds of commands to start working with KQL. They need to understand the thought model: in which table is the information, what is the time range, which rows are relevant, which fields are needed, and how to summarize the results to answer an investigation question.
KQL is a language for reading and analysis. It is not SQL, although there are similar concepts. Data flows from left to right through a Pipe — the | sign — and each line receives the result of the previous line. This allows you to build a small search, check a result, and add another step without writing everything at once.
The examples in this guide use common table and field names, but the Schema varies between Workspaces and sources. Before copying a Query, open a few records, check the actual fields, and adjust the logic. All data in the exercise is simulated.




