Heartbeat Last Heartbeats
Query
let query_period = 24h;
Heartbeat
| where TimeGenerated > ago(query_period)
| summarize arg_max(TimeGenerated, *) by Category, VMUUID, Computer, _ResourceId
| sort by Computer asc, VMUUID asc, Category asc, SourceComputerId asc
| project-reorder Category, TimeGenerated, Computer, ComputerIP, ComputerPrivateIPsExplanation
This KQL (Kusto Query Language) query is designed to analyze heartbeat data from virtual machines over the past 24 hours. Here's a breakdown of what it does in simple terms:
-
Define Time Period: It sets a time period of the last 24 hours (
query_period = 24h). -
Filter Data: It filters the
Heartbeattable to include only records where theTimeGeneratedtimestamp is within the last 24 hours. -
Summarize Data: It groups the data by
Category,VMUUID,Computer, and_ResourceId, and for each group, it selects the record with the most recentTimeGeneratedtimestamp. This is done using thearg_maxfunction, which returns the row with the maximum value ofTimeGeneratedfor each group. -
Sort Data: It sorts the resulting data in ascending order based on
Computer,VMUUID,Category, andSourceComputerId. -
Reorder Columns: Finally, it rearranges the columns to display
Category,TimeGenerated,Computer,ComputerIP, andComputerPrivateIPsin that specific order.
In summary, the query retrieves the latest heartbeat information for each unique combination of category, virtual machine, and computer over the past day, sorts the results, and organizes the output to focus on specific columns.
Details

Jose Sebastián Canós
Released: November 21, 2024
Tables
Keywords
Operators