Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@rmaziarka
Created January 26, 2021 20:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rmaziarka/764ed0b37e62c34f14299d41b53ae92b to your computer and use it in GitHub Desktop.
Save rmaziarka/764ed0b37e62c34f14299d41b53ae92b to your computer and use it in GitHub Desktop.
CosmosDB logs query
let queryRUChargeData = AzureDiagnostics
| where Category == "DataPlaneRequests"
| where OperationName == "Query"
| project requestCharge_s, operationType_s, activityId_g, databaseName_s, collectionName_s, requestResourceType_s, requestResourceId_s, OperationName, TimeGenerated, callerId_s, clientIpAddress_s, userAgent_s;
AzureDiagnostics
| where Category == "QueryRuntimeStatistics"
| join queryRUChargeData on $left.activityId_g == $right.activityId_g
| summarize SumRU = sum(todouble(requestCharge_s1)), Count = count(requestCharge_s1) by collectionname_s
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment