Azure日志分析查询如何判断属性是否存在

7

我正在尝试检查我的 customDimensions 对象是否具有某个属性,然后只计算已将该属性设置为某些内容的查询。但它正在计算那些在 customDimensions 对象中没有 SupportedLanguage 属性的查询。

这是我的当前查询:

customEvents
| where timestamp > ago(7d)
| summarize COUNT=count(customDimensions.SupportedLanguage) by lang=tostring(customDimensions.SupportedLanguage)
| render piechart

我尝试了以下操作,但没有成功:
customEvents
| where timestamp > ago(7d)
| where customDimensions.SupportedLanguage
| summarize COUNT=count(customDimensions.SupportedLanguage) by lang=tostring(customDimensions.SupportedLanguage)
| render piechart 
1个回答

14

您可以利用isnotempty()函数实现此目的:

customEvents
| where timestamp > ago(7d)
| where isnotempty(customDimensions.SupportedLanguage)

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接