Azure Cosmos Diagnostic queries 'summarize' operator: Failed to resolve scalar expression named 'databaseName_s'

Yasir Mehmood 1 Reputation point
2022-09-26T10:21:06.7+00:00

Hi,

I am facing an issue while querying the logs with Diagnostics enables. Below is the query and error:

AzureDiagnostics
| where ResourceProvider=="MICROSOFT.DOCUMENTDB" and Category=="DataPlaneRequests"
| where TimeGenerated >= ago(2h)
| summarize max(responseLength_s), max(requestLength_s), max(requestCharge_s), count = count() by OperationName, requestResourceType_s, userAgent_s, collectionRid_s, bin(TimeGenerated, 1h)

// Top logical partition keys by storage
// Identify largest logical partition key values. PartitionKeyStatistics will emit data for top logical partition keys by storage.
// To create an alert for this query, click '+ New alert rule'
AzureDiagnostics
| where Category == "PartitionKeyStatistics"
//| where collectionName_s == "CollectionToAnalyze" //Replace to target the query to a collection
| summarize arg_max(TimeGenerated, *) by databaseName_s, collectionName_s, partitionKey_s, _ResourceId //Get the latest storage size
| extend utilizationOf20GBLogicalPartition = sizeKb_d / 20000000 //20GB
| project TimeGenerated, databaseName_s , collectionName_s , partitionKey_s, sizeKb_d, utilizationOf20GBLogicalPartition, _ResourceId

'summarize' operator: Failed to resolve scalar expression named 'databaseName_s'
If the issue persists, please open a support ticket. Request id: 1459a071-3a98-4138-ab13-3922c7d7cefe

Azure Cosmos DB
Azure Cosmos DB
An Azure NoSQL database service for app development.
1,469 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Yasir Mehmood 1 Reputation point
    2022-09-29T18:08:56.123+00:00

    Hi,

    I just checked and it's working without making any change in the query. My assumption is that doesn't have data at that time so it's return errors

    Regards,
    Yasir