An administrator deploys the Azure Monitor agent to a virtual machine named VM-Prod1. The administrator needs to write a Kusto Query Language (KQL) query to retrieve all heartbeat events recorded for VM-Prod1 within the last hour. Which KQL query should you run?
- Heartbeat | where TimeGenerated > ago(1h) and Computer == "VM-Prod1"Answer
- BAzureDiagnostics | where TimeGenerated > ago(1h) and Resource == "VM-Prod1"
- CHeartbeat | filter TimeGenerated > ago(1h) and Computer == "VM-Prod1"
- DHeartbeat | where TimeGenerated > ago(1h) and Computer = "VM-Prod1"
Answer
Heartbeat | where TimeGenerated > ago(1h) and Computer == "VM-Prod1"
The correct query targets the Heartbeat table, filters logs from the last hour using 'where TimeGenerated > ago(1h)', and performs an equality comparison on the Computer column using the double equals (==) operator.
Step-by-Step Solution
Key Concept
Selecting the correct table and basic query operators in KQL for Azure Monitor VM heartbeats.
Estimated Time:45s