Skip to content

Instantly share code, notes, and snippets.

@mbiemann
Created March 22, 2023 11:58
Show Gist options
  • Save mbiemann/1706cd588e877c1b7c84f81a927aa98f to your computer and use it in GitHub Desktop.
Save mbiemann/1706cd588e877c1b7c84f81a927aa98f to your computer and use it in GitHub Desktop.
CloudWatch Logs Insights
filter @message like '[INFO]'
| filter @message not like 'Found credentials in environment'
| fields @timestamp, @message, substr(@message, 0, 6) as msg_level, substr(@message, 7, 24) as msg_timestamp, substr(@message, 32, 33) as msg_uuid, substr(@message, 69) as msg_body
| parse msg_body '"event": "*"' as event_str
| parse msg_body '"event": {*}' as event_json
| parse event_json '"messageType": "*"' as messageType
| stats count(*) as qty by event_str, messageType
| sort qty desc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment