Skill 4.2.2

Write KQL queries to analyze logs and metrics

Key Concepts

A KQL query starts from a table and passes rows through operators separated by the pipe character. where filters rows, project selects and renames columns, extend adds calculated columns, summarize aggregates with functions such as count(), avg(), percentile() and dcount() grouped by columns, bin(TimeGenerated, 5m) groups time, order by and top sort, and render timechart draws a chart. ago(1h) expresses relative time.

Workspace-based Application Insights stores requests in AppRequests, outgoing calls in AppDependencies, log records in AppTraces and errors in AppExceptions, linked by OperationId; the classic Application Insights query view uses requests, dependencies, traces and exceptions with operation_Id. Platform metrics are in AzureMetrics when diagnostic settings send them there, and join correlates tables.