我正在尝试使用记录到应用程序洞察的遥测数据通过共享仪表板添加一些功能,
当我为 FileName
和 Name
的 customDimensions 应用过滤器并应用 take 25
时,此查询为我提供了在条形图中呈现的所需结果> 它渲染得很好,并向我展示了特定持久 azure 函数的 25 个最慢的调用,其中操作 id 作为 y 轴,计算的持续时间(毫秒)在 x 轴上
customEvents
| extend FileName = tostring(customDimensions["FileName"])
| extend Name = tostring(customDimensions["Name"])
| extend OperationId = operation_Id
| summarize Duration=datetime_diff('millisecond', max(timestamp), min(timestamp)) by OperationId, Name, FileName
| order by Duration desc
| render barchart with (xtitle="Operation Id", ytitle="Duration (ms)", legend=hidden)
当我尝试将相同的查询(不带Where 子句)添加到共享仪表板时,我会应用相同的 FileName、Name 过滤器,然后看到不同的结果。
- 我无法申请
take 25
,因为这限制了我可以在 30 天内选择的FileName
- 当我选择
FileName
和Name
时,我可以看到图表发生变化,但当我选择OperationId
时,列表总数保持不变并且不会根据之前的输入进行过滤
如何复制与我使用提供的 FileName
和 Name
查询时显示的第一张图片中相同的结果,并仅获取一个子集(前 25 个) - 而仍然能够在共享仪表板中应用过滤器吗?
我尝试过使用工作簿,但不幸的是,从 appinsights 日志查询编译的这些查询看起来不同,并且您无法隐藏图例等内容,因此这是不可取的
最佳答案
How can I replicate the same results as in the first image shown where I am querying with provided
FileName
andName
and take only a subset (first 25) - while still being able to apply filters in a Shared Dashboard?
- I am not able to apply
take 25
as that limits theFileName
available for me to choose from over a 30-day period
我注意到,在您的查询中,您在使用扩展时收集了所有信息。
使用与您使用过的相同的查询
过滤总体结果的 25 个值
共享仪表板中的结果
- As I select
FileName
andName
I can see the graph changes but when I go to select aOperationId
the list total remains the same and does not filter based on the previous inputs
您可以使用 ${Filter_Name }
在查询中动态使用过滤器值。
例如:
Event | where ${Computers} | summarize count() by EventLevelName
关于azure - 通过 KQL 在共享仪表板中使用过滤,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/74525718/