- Here is my cloudwatch logs to count all the event types. I want only distinct values:
fields @timestamp, @message
| sort @timestamp desc
| filter @message like 'RDMErrors::'
| parse @message "[*] *" as LType, LMessage
| filter LType!= 'Error'
| parse @message 'RDMErrors::*::*::Type3::*:*' as eventType, identfier, name, rdmError
| stats count(*) as eventCount by eventType
Right now I am able to get all the count value of specific eventType. However I am looking to get only distinct count where mismatch values are not same across all of them. For eg:
lets say we have two instances of: eventType is eventA and mismatch value is B.
I get following result:
eventType eventCount
eventA 2
I just want 1 count for that.
- On The other hand I also have similar logs but this time I am just trying to display distinct logs which is not working. Here is my cw query:
fields @timestamp, @message
| sort @timestamp desc
| filter @message like 'RDMErrors::Both::'
| parse @message "[*] *" as LType, LMessage
| filter LType= 'Error'
| display LMessage
Any suggestion please?