microsoft / Kusto-Query-Language

Kusto Query Language is a simple and productive language for querying Big Data.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Getting an error when trying to get an agent node pool node count

mykolaichuk opened this issue · comments

I have the following query which fails when I try to get node count. Without NodeCount = properties_agentPoolProfiles.count query will work.

Resources
| where type == 'microsoft.containerservice/managedclusters'
| mv-expand properties.agentPoolProfiles
| where properties_agentPoolProfiles.name == "pool01"
| join kind=inner (
    resourcecontainers
    | where type == 'microsoft.resources/subscriptions'
    | project subscriptionId, subscriptionName = name)
    on subscriptionId
| where subscriptionName == 'Staging'
| project subscriptionName, name, location, VMSize = properties_agentPoolProfiles.vmSize, NodePoolName = properties_agentPoolProfiles.name, NodeCount = properties_agentPoolProfiles.count
| sort by name asc

Appreciate any help on this!

Some keywords (e.g. count) may require escaping

Try:

Resources
| where type == 'microsoft.containerservice/managedclusters'
| mv-expand properties.agentPoolProfiles
| where properties_agentPoolProfiles.name == "pool01"
| join kind=inner (
    resourcecontainers
    | where type == 'microsoft.resources/subscriptions'
    | project subscriptionId, subscriptionName = name)
    on subscriptionId
| where subscriptionName == 'Staging'
| project subscriptionName, name, location, VMSize = properties_agentPoolProfiles.vmSize, NodePoolName = properties_agentPoolProfiles.name, NodeCount = properties_agentPoolProfiles.['count']
| sort by name asc

Some keywords (e.g. count) may require escaping

Try:

Resources
| where type == 'microsoft.containerservice/managedclusters'
| mv-expand properties.agentPoolProfiles
| where properties_agentPoolProfiles.name == "pool01"
| join kind=inner (
    resourcecontainers
    | where type == 'microsoft.resources/subscriptions'
    | project subscriptionId, subscriptionName = name)
    on subscriptionId
| where subscriptionName == 'Staging'
| project subscriptionName, name, location, VMSize = properties_agentPoolProfiles.vmSize, NodePoolName = properties_agentPoolProfiles.name, NodeCount = properties_agentPoolProfiles.['count']
| sort by name asc

thanks, it worked!