Kusto 中有案例功能的方法吗?
Is there a way for case function in Kusto?
table MmsPoolProperty Azure Data Explorer 中没有说明池类型的列,因此我需要提取来自池名称的子字符串以检查池是内部池还是 public.
如果池名称包含子字符串“imc”,则它是私有的,如果包含“pmc”或“ghmc”,则为 public。
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")
case() 函数需要一个默认值作为最后一个参数,在末尾添加如下内容:
| extend PoolType = case(PoolName contains "imc","Internal",
PoolName contains "pmc","Public",
PoolName contains "ghmc","Public",
"Unknown")
table MmsPoolProperty Azure Data Explorer 中没有说明池类型的列,因此我需要提取来自池名称的子字符串以检查池是内部池还是 public.
如果池名称包含子字符串“imc”,则它是私有的,如果包含“pmc”或“ghmc”,则为 public。
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")
case() 函数需要一个默认值作为最后一个参数,在末尾添加如下内容:
| extend PoolType = case(PoolName contains "imc","Internal",
PoolName contains "pmc","Public",
PoolName contains "ghmc","Public",
"Unknown")