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.