Windows VMs send heartbeat data to a Log Analytics workspace. Which Kusto query returns the most recent heartbeat time for each computer?
- A.
Heartbeat | summarize count() by TimeGenerated - B.
Heartbeat | where Computer == max(TimeGenerated) - C.
Heartbeat | summarize LastHeartbeat = max(TimeGenerated) by Computer - D.
Heartbeat | project Computer | distinct
Show answer and explanation
Answer: C
summarize ... by Computer groups rows per computer, and max(TimeGenerated) finds the latest heartbeat for each.
Heartbeat | summarize count() by TimeGenerated: It counts rows per timestamp, not the latest time per computer.Heartbeat | where Computer == max(TimeGenerated): This compares a computer name to a time value and is not valid logic.Heartbeat | project Computer | distinct: It lists unique computers but returns no time information.