在 Timestamp 上添加 Where 条件会产生奇怪的聚合结果

Adding Where condition on Timestamp yields odd aggregated results

我是第一次查看 Azure Monitor 查询,不明白为什么要添加这一行:

| where timestamp <= ago(1days)

使得查询结果"de-aggregated."

2 个单独的屏幕截图 queries/results:

期望的输出

不需要的输出

您应该使用的运算符是 timestamp >= ago(1d),它应该选择具有最近 24 小时时间戳的行。

示例如下

requests
| where timestamp >= ago(1d)
| summarize C = count() by itemType

Explorer 的输出在查询中带有时间戳

requests
| summarize C = count() by itemType

带有时间范围内时间戳的资源管理器输出

Documentation reference for using ago()

希望对您有所帮助!