Application Insight Analytics数据透视 [英] Application Insight Analytics Pivot
问题描述
有没有一种方法可以透视Azure应用程序洞察力分析查询? SQL具有枢纽关键字,可以可以在应用程序分析Analytics ?
Is there a way to pivot in Azure Application insight analytic queries? SQL has a Pivot Keyword, can similar be achieved in Application insight Analytics?
当我运行以下查询时,我得到了异常和计数,但是我希望看到一天中的趋势
When I run the below query I get exceptions and count, but I would like to see a day on day trending
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_
我正在寻找不明智的选择.
I am looking for something below day wise.
推荐答案
实现与您所需要的东西相似的最简单方法是使用:
The easiest way to achieve something similar to what you need is by using:
exceptions
| where timestamp >= ago(7d)
| summarize count() by type, bin(timestamp, 1d)
这将使每种类型每天输出一行.并非完全符合您的要求,但是在图形中呈现时会看起来不错(每种类型都会为您提供一行).
This will give in the output one line per-type, per-day. Not exactly what you wanted but it will look good when rendered in graph (will give you a line for each type).
要获得一个与示例中所用表相似的表会更困难,但是此查询可以解决问题:
To get a table similar to what you put in your example would be more difficult, but this query should do the trick:
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
这篇关于Application Insight Analytics数据透视的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!