Cloudwatch log insight for showing prev week and current week count as well as diff - Stack Overflow

I need to imitate the sumologic dashboard to cloudwatch. I need a widget showing the count of transacti

I need to imitate the sumologic dashboard to cloudwatch. I need a widget showing the count of transactions for this week against previous week and the difference in hourly manner. Is it possible to do this in cloudwatch?

What I tried:

fields @timestamp, @message
| parse @message /com\.xxx\.x\confirmation (?<json>.*)/ 
| fields jsonParse(json) as parsedJson
| filter parsedJson.bookingStatus = "SUCCESS"
| stats sum(if(toMillis(@timestamp) >= now() - 604800000, count(parsedJson.pnr), 0)) as current_week_count,
        sum(if((toMillis(@timestamp) >= now() - 1209600000 and @timestamp < now() - 604800000, count(parsedJson.pnr), 0)) as previous_week_count
| sort @timestamp desc
| display current_week_count, previous_week_count, current_week_count - previous_week_count as difference

Issue: Type Mismatch

Also tried a few functions which didn't work.diff (compare on) gives me the difference but im struggling to get the current and prev week count in same widget along with diff.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744803508a4594632.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信