azure - 应用洞察 : how can i get first 'details' column in the 'problemId' group

标签 azure azure-application-insights azure-log-analytics azure-data-explorer

我在 App Insights 中按 ProblemId 查询了异常的计数:

// exception count by problem ID
let start=datetime("2018-01-09T14:17:00.000Z");
let end=datetime("2018-01-10T14:17:00.000Z");
let timeGrain=5m;
let dataset=exceptions
// additional filters can be applied here
| where timestamp >= ago(24h)
| where client_Type == "PC" ;
dataset
| project problemId, cloud_RoleName, itemCount, details 
| summarize count_=sum(itemCount) by problemId, cloud_RoleName, stacktrace_ = (tostring(details))
// calculate exception count for all exceptions
| union(dataset
| summarize count_=sum(itemCount)
| extend problemId="Overall")
| order by count_ desc

我还想包含堆栈跟踪,但我只想获取一组“problemId”的第一个“详细信息”列。有任何想法吗?谢谢

最佳答案

我认为没有用于汇总的 first() 运算符,但如果您只想为每个组提供一个(随机)值,则可以使用 any() 运算符。

喜欢

 | summarize count_=sum(itemCount), any(details) by problemId, ...

“first”通常意味着组内的某种顺序,因此我不确定是否有一种简单的方法可以做到这一点而不会使查询变得更加复杂。

参见:https://docs.loganalytics.io/docs/Language-Reference/Aggregation-functions/any()

关于azure - 应用洞察 : how can i get first 'details' column in the 'problemId' group,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48190641/

相关文章:

azure - Polybase over Data Lake - 什么是 OAuth_2.0_Token_EndPoint?

Azure Arr 关联响应 cookie

Azure DNS 重定向到 www

python - 获取 Azure 中连接到不同订阅中的工作区的虚拟机的日志分析工作区 ID

azure - 如何将 Azure 成本和使用数据发送到日志分析工作区或直接发送到 azure 指标?

Azure NAT 网关具有 Azure 功能的多个可用区

c# - 无法从 Azure Function 应用程序的 Nuget 安装 ApplicationInsights

azure - 可用性测试仪表板

Azure 指标图图例

azure - 有没有办法监控Azure文件容量