Application Insights Analytics执行子选择 [英] Application Insights Analytics doing sub selects

查看:82
本文介绍了Application Insights Analytics执行子选择的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用此参考资料文档获得应用程序见解.

I am using this reference documentation for Application Insights.

如何使用其他查询的输出进行子选择?

How can I do a sub-select using the output of a different query?

//Query 1
Events 
| where  Timestamp >= ago(30min) and Data contains('SomeString')
| project TraceToken

//I would like to use the first query's output in the subselect here.
Events 
| where TraceToken in ({I would like to use the First query's output here.})

在这种情况下,联接更好.哪个会有更好的性能.

Is a join better in this scenario. Which would have better performance.

推荐答案

您可以使用let语句来实现.

You can use let statement to achieve this.

以下是 Analytics文档中的示例,我希望这会有所帮助:

Here is an example from the Analytics documentation, I hope this helps:

let topCities =  toscalar ( // convert single column to value
   requests
   | summarize count() by client_City 
   | top 4 by count_ 
   | summarize makeset(client_City));
requests
| where client_City in (topCities) 
| summarize count() by client_City;

编辑:默认情况下,

Edit: By default the maximum number of elements returned by the makeset() function is 128. The MaxSetSize should be specified for larger dataSets.

这篇关于Application Insights Analytics执行子选择的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆