如何在 AWS CloudWatch Insights 中按字段然后按 bin 聚合日志?

How to aggregate logs by field and then by bin in AWS CloudWatch Insights?

我正在尝试执行一个查询,该查询将首先按字段计数聚合,然后再按 bin(1h) 聚合,例如,我想获得如下结果:

# Date                     Field Count
1 2019-01-01T10:00:00.000Z A     123
2 2019-01-01T11:00:00.000Z A     456
3 2019-01-01T10:00:00.000Z B     567
4 2019-01-01T11:00:00.000Z B     789

不过不确定是否可行,查询应该类似于:

fields Field
| stats count() by Field by bin(1h)

有什么实现方法吗?

这是你需要的吗?

fields Field | stats count() by Field, bin(1h)

无法按特定字段分组并创建可视化效果。

fields Field
| stats count() by Field, bin(1h)

不断收到此消息

No visualization available. Try this to get started:
stats count() by bin(30s)