Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to filter out duplicate values from CloudWatch logs?

I have my Android app's logs in CloudWatch. One event am tracking is giving data like this.

Using 'count_distinct' it's giving count as 242 and while using 'count', it gives 243. So one duplicate entry is there.

I have id field as well. And i guess it might be repeating. How can i filter it out?

like image 647
Jai Avatar asked Oct 27 '25 08:10

Jai


1 Answers

Assuming you have 242 unique IDs among the 243 log events, you can group on ID and filter out the unique results like this:

stats count() as cnt by ID | filter cnt > 1

like image 188
gangreen Avatar answered Oct 28 '25 21:10

gangreen



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!