2017-11-10 68 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上的過濾器