【问题标题】:Azure Log Analytics query if property existsAzure Log Analytics 查询属性是否存在
【发布时间】:2018-10-11 04:55:44
【问题描述】:

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

【问题讨论】:

    标签: azure azure-application-insights azure-log-analytics


    【解决方案1】:

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

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-08-03
      • 2020-11-09
      • 2018-07-28
      • 1970-01-01
      • 2021-03-20
      相关资源
      最近更新 更多