You need to write a Kusto Query Language (KQL) query in Azure Log Analytics to find all heartbeat records from the last 24 hours for a virtual machine named VM1. Which KQL query should you use?
- AHeartbeat | where TimeGenerated > ago(24h) and Computer = "VM1"
- BSELECT * FROM Heartbeat WHERE TimeGenerated > ago(24h) AND Computer = 'VM1'
- Heartbeat | where TimeGenerated > ago(24h) and Computer == "VM1"Cevap
- DHeartbeat | filter TimeGenerated > ago(24h) and Computer == "VM1"
Cevap
The KQL query that retrieves heartbeat records using the 'where' operator and the double equals (==) comparison operator: Heartbeat | where TimeGenerated > ago(24h) and Computer == "VM1"
The query correctly initiates the scan of the Heartbeat table, pipes it to the where operator to filter based on TimeGenerated using the ago() function, and applies the string comparison constraint on the Computer column using the double equals (==) operator.
Adım Adım Çözüm
Anahtar Kavram
Basic KQL querying using the where operator, time ranges, and equality comparisons.