An administrator wants to review write operations on virtual machines within an Azure subscription. They open the Log Analytics query editor to search the `AzureActivity` table. The query must filter for logs where `OperationNameValue` is equal to `'Microsoft.Compute/virtualMachines/write'` and restrict the output to exactly records.
Which of the following queries use valid Kusto Query Language (KQL) syntax to achieve this goal? (Choose two.)
- AzureActivity | where OperationNameValue == "Microsoft.Compute/virtualMachines/write" | limit 5Answer
- AzureActivity | where OperationNameValue == "Microsoft.Compute/virtualMachines/write" | take 5Answer
- CAzureActivity | where OperationNameValue = "Microsoft.Compute/virtualMachines/write" | limit 5
- DSELECT * FROM AzureActivity WHERE OperationNameValue = 'Microsoft.Compute/virtualMachines/write' LIMIT 5
Answer
The correct queries start with the 'AzureActivity' table, filter the logs using the 'where' operator with double equals '==', and limit the records using either 'limit 5' or 'take 5'.
The correct queries begin with the data source 'AzureActivity', apply a pipeline using the pipe character '|', use the 'where' operator with the equality operator '==', and use either 'limit 5' or 'take 5'. In KQL, 'limit' and 'take' are synonyms and perform the same action of limiting the result set.
Step-by-Step Solution
Key Concept
Basic KQL query structure, comparison operators, and row-limiting operators.
Estimated Time:45s