Azure Log Analytics 查询如果 属性 存在

Azure Log Analytics query if property exists

我正在尝试检查我的 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 

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

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