【发布时间】:2021-09-09 05:01:28
【问题描述】:
我编写了一个简单的查询,显示来自多个 Application Insights 实例的异常:
app('app_insights_name_1').exceptions
| more unions here
| union app('app_insights_name_n').exceptions
| where timestamp > ago(24h)
| summarize count() by problemId, appName
| sort by count_ desc
我还设法编写了一个查询来查找我希望第一个查询运行的所有 App Insights 实例:
resources
| where type in ~('microsoft.insights/components', 'microsoft.insights')
| where(resourceGroup in ~('dev', 'test'))
我认为不可能将这两个查询结合起来,但我想知道是否可以查询一个或多个资源组中给定类型的所有实例的异常表(或 Trace 或任何其他)的联合?
从概念上讲,我希望得到类似于以下查询的内容:
resources
| where type in ~('microsoft.insights/components', 'microsoft.insights')
| where(resourceGroup in ~('dev', 'test'))
| MAGIC_HERE : get union of all exception tables from above
| where timestamp > ago(24h)
| summarize count() by problemId, appName
| sort by count_ desc
【问题讨论】:
标签: azure-log-analytics kql azure-monitoring