An administrator configures diagnostic settings for an Azure Key Vault named Vault1 to send all audit logs to a Log Analytics workspace. In the diagnostic settings configuration, the administrator selects the Resource-specific destination table option.
The administrator needs to write a KQL query that retrieves the count of failed secret retrieval (SecretGet) operations over the last seven days, grouped by the name of the secret.
Which KQL query should the administrator run?
- AKVAudit
| where TimeGenerated > ago(7d)
| where OperationName == "SecretGet"
| where ResultSignature != "200"
| summarize count() by ObjectNameCevap - BAzureDiagnostics
| where TimeGenerated > ago(7d)
| where OperationName == "SecretGet"
| where ResultSignature != "200"
| summarize count() by ObjectName_s - CAKVAudit
| where TimeGenerated > ago(7d)
| where OperationName == "SecretGet"
| where ResultSignature != "200"
| summarize count() by ObjectName_s - DAKVAudit
| where TimeGenerated > ago(7d)
| where OperationName == "SecretGet"
| where ResultSignature != "200"
| group by ObjectName
Cevap
The query that targets the AKVAudit table, filters by a TimeGenerated within the last seven days, specifies the 'SecretGet' OperationName, filters out successful '200' responses in ResultSignature, and aggregates the count using the summarize operator by the ObjectName column.
The correct query targets the AKVAudit table because Key Vault diagnostic logs are directed to this table when the Resource-specific destination option is selected. It correctly filters for the 'SecretGet' operation type, identifies failures by checking for a ResultSignature other than the HTTP success status code of '200', and aggregates the results by the ObjectName column using the KQL summarize operator.
Adım Adım Çözüm
Anahtar Kavram
Querying resource-specific Azure diagnostic logs using KQL
Tahmini Süre:2m 0s