2017-11-10 156 views
0

我有一个应用程序洞察查询。在这个查询中,我想将多个列加入/组合成单个列来显示,这是如何实现的。应用程序洞察加入/组合列到单个列中

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

回答

0

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

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

此外,| where (itemType == 'customEvent')在查询中是不必要的,因为在一切customEvents表已经是customEvent。如果您以某种方式连接多个表格(如union requests, customEventsjoin或查询中引用多个表格的某个地方),则只需要itemType上的过滤器