【问题标题】:Application Insights Join/Combine Columns Into A Single ColumnApplication Insights 将列加入/组合成单个列
【发布时间】:2018-04-24 05:48:59
【问题描述】:

我有一个应用洞察查询。在这个查询中,我想将几​​列加入/组合成一列,以显示如何完成。

我想结合ip、城市、州、国家。

customEvents
| where timestamp >= ago(7d)
| where (itemType == 'customEvent')
| where name == "Signin"
| project timestamp, customDimensions.appusername,   client_IP,client_City,client_StateOrProvince, client_CountryOrRegion 
| order by timestamp desc

【问题讨论】:

    标签: azure-application-insights ms-app-analytics


    【解决方案1】:

    strcat 是你的朋友,用你想要的任何字符串作为分隔符(我只是在示例中使用空格):

    | project timestamp, customDimensions.appusername, 
      strcat(client_IP," ",client_City," ",client_StateOrProvince," ", client_CountryOrRegion)
    

    另外,查询中的| where (itemType == 'customEvent') 是不必要的,因为customEvents 表中的所有内容都已经是customEvent。如果您以某种方式连接多个表(例如查询中引用多个表的union requests, customEventsjoin),则只需要在itemType 上使用类似的过滤器

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-10-12
      • 1970-01-01
      • 1970-01-01
      • 2016-07-16
      • 2011-06-26
      • 1970-01-01
      相关资源
      最近更新 更多