提问人:Mahima 提问时间:11/11/2023 最后编辑:Mahima 更新时间:11/15/2023 访问量:38
通过 CloudWatch Insights 实现可视化
Visualization through CloudWatch Insights
问:
我正在 CloudWatch 日志中记录自动化结果。格式如下:
(XXXX-XXXX) Endpoint request body after transformations:
{
"executionDetails": {
"executionId": "uniqueExecutionId",
"userName": "<userName>",
"sourcePackage": "<testPackage>"
}
}
现在,我想了解我们框架的唯一用户数量。如何通过 CloudWatch Insights 获取这些数据?
我尝试了以下查询:
fields @timestamp, @message
| filter @message like /Endpoint request body after transformations:/
| parse @message "userName" as userName
| stats count(userName) as UniqueMessageCount by userName
| sort UniqueMessageCount desc
这也是:
fields @timestamp, @message
| filter @message like /Endpoint request body after transformations:/
| parse @message "userName" as users
| stats count(users) as uniqueMessageCount by users
| sort uniqueUsers desc
但这似乎并没有给出正确的结果。我发现了以下问题,这似乎与我所问的问题相似,但所有答案都给出了不正确的结果 - 在 aws cloudwatch 指标中计算唯一值。
我还需要记录哪个用户执行了多少次。谁能帮我解决这个问题?
分享我的数据示例:
|":"John","sourcePackage":"<my package 1 >"}}| 1
|":"John","sourcePackage":"<my package 2 >"}}| 1
这 2 个应显示为:
|"John"| 2
答: 暂无答案
评论
"userName": "<userName>, "sourcePackage": "<testPackage>"