应用洞察将列加入/组合成单列

时间:2017-11-10 22:43:57

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

我有一个应用程序见解查询。在这个查询中,我想将几​​个列连接/组合成一个列,以显示如何实现这一目标。

我想结合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

1 个答案:

答案 0 :(得分:4)

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

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

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

相关问题