如何解决在Amazon Cloudwatch Insights中,您如何获取统计数据?
我正在使用AWS Cloudwatch Insights并运行如下查询:
public function scopeTopFeatures(Builder $query,$topFeatureIds): Builder
{
return $query->whereHas('features',function (Builder $query) use ($topFeatureIds) {
$query->whereIn('vehicle_feature_id',$topFeatureIds);
});
}
但是,在最后一行,出现以下错误:
fields @message,@timestamp
| filter strcontains(@message,"Something of interest happened")
| stats count() as interestCount by bin(10m) as tenMinuteTime
| stats max(interestCount) by datefloor(tenMinuteTime,1d)
由此看来,这意味着我无法在Insights中进行多层统计查询,因此无法进行统计。有办法解决吗?
解决方法
您当前无法使用多个stat命令,据我所知,目前尚无直接方法。但是,您可以加厚单个stat命令并以逗号分隔,如下所示:
MenuItem
您定义字段并在fields @message,@timestamp
| filter strcontains(@message,"Something of interest happened")
| stats count() as @interestCount,max(interestCount) as @maxInterest,interestCount by bin(10m) as @tenMinuteTime
之后使用函数,然后处理这些结果字段。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。