Queries for the CHSMServiceOperationAuditLogs table

For information on using these queries in the Azure portal, see Log Analytics tutorial. For the REST API, see Query.

Are there any slow requests?

List of Cloud HSM requests taking longer than 1 second.

let threshold=1000;
CHSMServiceOperationAuditLogs
| where DurationMs > threshold
| summarize count() by OperationName, _ResourceId

How active has this Cloud HSM been?

Line chart showing trend of Cloud HSM requests volume, per operation over time.

CHSMServiceOperationAuditLogs
| summarize count() by bin(TimeGenerated, 1h), OperationName // Aggregate by hour
| render timechart

Are there any failures?

Count of failed requests by request type

CHSMServiceOperationAuditLogs
| where ResultType == "Failure"
| summarize count() by ResultSignature, _ResourceId

Who is calling this Cloud HSM?

List of callers identified by their IP address with their request count.

CHSMServiceOperationAuditLogs
| summarize count() by CallerIpAddress