有关在 Azure 门户中使用这些查询的信息,请参阅 Log Analytics 教程。 有关 REST API,请参阅查询。
按状态代码列出的失败密钥保管库请求计数。
AZKVAuditLogs
| where HttpStatusCode >= 300 and not(OperationName == "Authentication" and HttpStatusCode == 401)
| summarize count() by RequestUri, ResultSignature, _ResourceId
长于 1 秒的密钥保管库请求的列表。
let threshold=1000;
AZKVAuditLogs
| where DurationMs > threshold
| summarize count() by OperationName, _ResourceId
显示每个操作随时间推移的密钥保管库请求量趋势的折线图。
AZKVAuditLogs
| summarize count() by bin(TimeGenerated, 1h), OperationName // Aggregate by hour
| render timechart
显示使用不同聚合的随时间推移的请求持续时间趋势的折线图。
AZKVAuditLogs
| summarize avg(DurationMs) by RequestUri, bin(TimeGenerated, 1h) // requestUri_s contains the URI of the request
| render timechart
列出过去 30 天内的所有更新和补丁请求。
AZKVAuditLogs
| where TimeGenerated > ago(30d)
| where OperationName == "VaultPut" or OperationName == "VaultPatch"
| sort by TimeGenerated desc
按调用方的 IP 地址及其请求计数识别的调用方列表。
AZKVAuditLogs
| summarize count() by CallerIpAddress