Joh*_*ner 7 visualization group-by amazon-cloudwatch amazon-cloudwatchlogs aws-cloudwatch-log-insights
我想在 AWS CloudWatch Logs Insights 中创建包含两行的折线图。一条线代表移动用户和其他桌面用户,显示每组用户的成功率。
这是我正在使用的代码:
| fields
properties.device as device,
properties.success as success
| stats avg(success) by device, bin(1hour)
Run Code Online (Sandbox Code Playgroud)
这个查询的结果看起来很有希望。如您所见,结果包括设备类型、时间戳和要绘制在折线图上的浮点数:
# device bin(1hour) avg(success)
1 desktop 2023-02-01T10:00:00.000 0.6129
2 mobile 2023-02-01T10:00:00.000 0.7453
3 desktop 2023-02-01T09:00:00.000 0.5578
4 mobile 2023-02-01T09:00:00.000 0.6082
Run Code Online (Sandbox Code Playgroud)
但是,“可视化”选项卡向我显示了此错误:
The data is not suitable for a line chart.
Try a bar chart, or group your result by bin function.
Run Code Online (Sandbox Code Playgroud)
我认为 Logs Insights 对我重叠的时间戳感到困惑。它不知道我想要一个移动数据的时间序列和另一个桌面数据的时间序列。要按字段分组并按时间分组,我似乎正在使用带有两个参数的单个操作来执行标准操作by。但它还不足以创建折线图。
有没有更好的方法来构建我的查询以使 CloudWatch 相信我正在尝试做的事情?
| 归档时间: |
|
| 查看次数: |
1388 次 |
| 最近记录: |