Azure Application Insights 中的持续时间范围

Ongoing time frame in Azure Application Insights

这一行在我的 Azure Application Insights Kusto 查询中:

pageViews 
| where timestamp between(datetime("2020-03-06T00:00:00.000Z")..datetime("2020-06-06T00:00:00.000Z"))

每次我 运行 它,我手动用当前日期和当前日期减去 ~90 天替换 datetime 值。有没有一种方法可以编写查询,无论我在哪一天 运行 它默认使用那天减去 90 天?

90 的原因是我相信 Azure Application Insights 最多允许导出最近 90 天的数据。在其他查询中,如果可能的话,我可能会选择使用负 30 天或负 7 天。

如果这很容易在 Microsoft 文档中发现而我在探索过程中遗漏了它,我深表歉意。

感谢您提供的任何见解。

IIUC,您对运行这样的东西感兴趣:

pageViews 
| where timestamp between(startofday(ago(90d)) .. startofday(now()))

(根据您的要求,您可以省略 startofday(),或使用 endofday(),或执行任何其他 datetime-manipulation/arithmetics)

应该很容易使用ago operator。查询如下:

pageViews
| where timestamp >ago(90d) //d means days here.

为此 The reason for 90 is I believe Azure Application Insights allows a maximum of the most recent 90 days to exported。您可以查看 Continuous Export 功能,它不同于通过查询导出。并且您可以根据自己的需要选择两者中较好的一个。