Study workspace

Prepare for SC-200 with a reference that remembers your progress.

All nine learning paths now run in the new architecture. Select one to reveal its brief and modules.

09 / 09

Choose a learning path

0/404 units
04Create queries for Microsoft Sentinel using KQL4 modules · 29 units · Query construction, aggregation, visualization, multi-table analysis, parsing, and reusable functions0/29 units complete
Learning path 04 · Create queries for Microsoft Sentinel using KQL

4 modules · 29 units · Query construction, aggregation, visualization, multi-table analysis, parsing, and reusable functions

0%

Study focus

KQL foundations

Build statements with filtering, projection, aggregation, time operations, and visualization.

Investigation queries

Analyze multi-table data with joins, unions, parsing, reusable functions, and Sentinel security context.

4 modules · 29 units

Select one or more modules

Each click adds or removes a module from your workspace. Units remain closed until you open them.

04

Module 4

Work with data in Microsoft Sentinel using Kusto Query Language

Focus: unstructured parsing, dynamic JSON fields, external reference data, and reusable parser functions.
0/7
01 / 07Introduction

Ingested security logs often store important values inside free-form messages, JSON objects, arrays, or external files. KQL can extract and normalize those values into reusable tabular schemas.

Official moduleData manipulation objectives
02 / 07Extract data from unstructured string fields

extract() uses a regular expression and capture-group number to return one substring, optionally converted to a type. It returns null if no match exists or conversion fails.

SecurityEvent
| extend AccountName = extract(
    @"^(.*\\)?([^@]*)(@.*)?$", 2,
    tolower(Account))

parse matches a larger string pattern and creates several calculated columns at once. Its modes are simple, regex, and relaxed; fields that cannot be parsed become null.

Exam takeaway: use extract for a specific regex capture; use parse when a predictable message layout contains multiple fields.
Official lessonRegex extraction and parse patterns
03 / 07Extract data from structured string data

The dynamic type stores arrays and property bags. Access a property with dot or bracket notation and convert it to a scalar when an operator requires a specific type.

SigninLogs
| extend OS = tostring(DeviceDetail.operatingSystem),
         StatusCode = tostring(Status.errorCode)
Function / operatorPurpose
parse_json() / todynamic()Interpret a JSON string as a dynamic value.
mv-expandCreate one output row for each array or property-bag value.
mv-applyRun a subquery against each multi-value element and union the results.
Official lessonDynamic fields, JSON, and arrays
04 / 07Integrate external data

externaldata defines a table schema inside the query and reads rows from an external storage artifact such as Azure Blob Storage or Data Lake Storage. It is suited to relatively small reference datasets, not high-volume continuous ingestion.

let KnownIPs = externaldata(IPAddress:string)
[
  h@"https://storage.example/known.csv?...SAS..."
]
with (format="csv", ignoreFirstRecord=true);
SigninLogs
| where IPAddress in (KnownIPs)

Protect storage credentials and SAS tokens; avoid placing secrets in shared query text. This operator is unavailable in the public demo environment used by the lesson.

Official lessonExternal reference tables
05 / 07Create parsers with functions

A parser is a KQL function that converts source-specific unstructured data into a stable virtual table. In the Logs window, create and test the query, select Save, choose Save as function, and assign a function name and optional parameters.

// Saved as function: PrivLogins
SecurityEvent
| where EventID == 4672
| where AccountType == "User"

// Reuse later
PrivLogins
| summarize Events = count() by Account

Functions centralize normalization logic so analytics rules, workbooks, and hunting queries share the same schema and corrections.

Official lessonSaved parser functions
06 / 07Module assessment

Distinguish extract from parse, scalar values from dynamic fields, mv-expand from mv-apply, external reference data from ingested logs, and an ad hoc query from a saved parser function.

Official assessmentData manipulation knowledge check
07 / 07Summary and resources

Normalize security data at query time by extracting stable fields, expanding structured arrays carefully, enriching with governed external data, and saving repeated parsing logic as functions.

Official moduleSummary and resources
End of learning pathCreate queries for Microsoft Sentinel using KQL