Skill 5.1.3
Query and analyze logs in Azure Monitor
Key Concepts
A KQL query starts with a table, such as AzureActivity, AzureDiagnostics, Heartbeat, Perf, Event, Syslog or StorageBlobLogs, followed by operators separated by a pipe (|). where filters rows, project selects columns, extend adds calculated columns, summarize aggregates with functions such as count(), avg() and bin(TimeGenerated, 5m), sort by and top order results, join combines tables and render draws a chart. The time range picker or where TimeGenerated > ago(1h) limits the period.
Queries run in Logs on a workspace (all data) or on a resource (resource-context data only). Saved queries, query packs and the example queries provide starting points, and results can be pinned to dashboards, added to workbooks or used in log search alert rules. For example, Heartbeat | summarize LastSeen = max(TimeGenerated) by Computer | where LastSeen < ago(15m) finds VMs that have stopped reporting.