如何在Azure Application Insights Analytics上做到与众不同

时间:2018-09-24 18:50:50

标签: azure azure-application-insights

我目前使用Application Insights Analytics运行以下查询:

customEvents 
| where name == 'Event Name 1' 
| project ['Column One'] = customDimensions['CD1'], ['Column Two'] = customDimensions['CD2'], ['Column Three'] = customDimensions['CD3']

上面的查询返回了一些如下结果:

Column One | Column Two | Column Three
    A      |     2      |      D
    B      |     3      |      E
    C      |     2      |      F

如何获取查询以仅返回第二列上的不同值?基本上我希望我的结果是:

Column One | Column Two | Column Three
    A      |     2      |      D
    B      |     3      |      E

任何帮助将不胜感激!

1 个答案:

答案 0 :(得分:1)

您可以执行以下操作:

customEvents 
| where name == 'Event Name 1' 
| project ['Column One'] = tostring(customDimensions['CD1']),
          ['Column Two'] = tostring(customDimensions['CD2']),
          ['Column Three'] = tostring(customDimensions['CD3'])
| summarize any(['Column One']), any(['Column Three']) by ['Column Two']

这将获取第一个-不一定是“ A,C”对中的A。如果要排除“ C”,则需要使用其他汇总聚合器,例如makelist / makeset。