An administrator needs to identify all virtual machines that were successfully deleted in an Azure subscription during the last 24 hours. The diagnostic data is sent to a Log Analytics workspace.
Which of the following Kusto Query Language (KQL) queries will successfully return the records? (Select two.)
- AzureActivity
| where TimeGenerated > ago(24h)
| where OperationNameValue =~ "Microsoft.Compute/virtualMachines/delete" and ActivityStatusValue =~ "Succeeded"Answer - AzureActivity
| where TimeGenerated >= ago(1d)
| where OperationName == "Microsoft.Compute/virtualMachines/delete"
| where ActivityStatus == "Succeeded"Answer - CAzureActivity
| where TimeGenerated > ago(24h)
| where OperationNameValue = "Microsoft.Compute/virtualMachines/delete" and ActivityStatusValue = "Succeeded" - DSELECT * FROM AzureActivity
WHERE TimeGenerated > ago(24h)
AND OperationNameValue == "Microsoft.Compute/virtualMachines/delete"
Answer
The two correct queries start with the AzureActivity table name and use valid KQL filtering syntax, utilizing either the double equals (==) or the case-insensitive (=~) comparison operator along with the ago() function for time filtering.
The correct queries successfully retrieve the virtual machine deletion events by referencing the AzureActivity table, filtering by the last 24 hours using ago(24h) or ago(1d), and filtering for the delete operation and succeeded status using correct comparison operators (== or =~).
Step-by-Step Solution
Key Concept
Writing KQL queries on AzureActivity to filter resource events by time, operation, and status.