【问题标题】:Application Insight Analytics PivotApplication Insight 分析枢轴
【发布时间】:2017-06-16 08:58:42
【问题描述】:

有没有办法在 Azure 应用程序洞察分析查询中进行透视? SQL有个Pivot Keyword,在Application insight Analytics可以实现类似的吗?

当我运行下面的查询时,我得到了异常和计数,但我希望看到一天一天的趋势

exceptions 
| where timestamp >= ago(24h) 
| extend Api = replace(@"/(\d+)",@"/xxxx", operation_Name)
| summarize count() by type
| sort by count_ desc 
| limit 10
| project Exception = type, Count = count_ 

我正在寻找低于天数的东西。

【问题讨论】:

  • 你能解释一下你想要达到的目标吗?在 Google Analytics(分析)中可能有不同的方法来做到这一点
  • 谢谢@EranG 我已经添加了更多信息

标签: azure azure-application-insights ms-app-analytics


【解决方案1】:

实现与您所需类似的最简单方法是使用:

exceptions
| where timestamp >= ago(7d)
| summarize count() by type, bin(timestamp, 1d) 

这将在输出中每天为每种类型提供一行。不完全是您想要的,但在图形中呈现时看起来会很好(每种类型都会为您提供一条线)。

要获得与您在示例中放置的表相似的表会更加困难,但这个查询应该可以解决问题:

exceptions 
| where timestamp >= startofday(ago(3d)) 
| extend Api = replace(@"/(\d+)",@"/xxxx", operation_Name)
| summarize count() by type, bin(timestamp, 1d)
| summarize 
    Today = sumif(count_, timestamp == startofday(now())),
    Today_1 = sumif(count_, timestamp == startofday(ago(1d))),
    Today_2 = sumif(count_, timestamp == startofday(ago(2d))),
    Today_3 = sumif(count_, timestamp == startofday(ago(3d)))
    by type

【讨论】:

  • 这不是我想要的,我需要构建一个 HTML 来发送邮件并且无法使用图表。有没有其他方法可以将行转换为列,任何指针或指导都会有所帮助
  • 我编辑了我的答案以产生你想要的东西
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2019-10-28
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多