0

Azure 数据资源管理器中的表MmsPoolProperty中没有说明池类型的列,因此我需要从池名称中提取子字符串以检查池是内部的还是公共的。

如果池名称包含子字符串“imc”它是私有的,如果包含“pmc”或“ghmc”是公共的。

MmsPoolProperty
| where TIMESTAMP > ago(1d)
| where ImageName contains "mac" or ImageName contains "osx"
| summarize arg_max(TIMESTAMP, AllPropertiesBlob) by PoolName // We can get rid of this once the decoupling has been rolled out for long enough that we don't have old telemetry
| extend props = parse_json(AllPropertiesBlob)
| project PoolName, UnitName = coalesce(props["VmControllerName"], PoolName) 
| extend PoolType = case(PoolName contains "imc","Internal",
                         PoolName contains "pmc","Public",
                         PoolName contains "ghmc","Public")
4

1 回答 1

1

case() 函数需要一个默认值作为最后一个参数,在最后添加如下内容:

| extend PoolType = case(PoolName contains "imc","Internal",
                         PoolName contains "pmc","Public",
                         PoolName contains "ghmc","Public",
                         "Unknown")
于 2021-10-11T14:10:59.350 回答