- Newest
- Most votes
- Most comments
To create a CloudWatch line chart with multiple lines, where each line represents the count of occurrences of a specific event type over time, you can use CloudWatch Logs Insights to query your logs and then visualize the results. Given your requirement to dynamically handle event types without hardcoding them, you'll need to construct a query that extracts unique event types and counts their occurrences over specified time intervals.
You can use CloudWatch Logs Insights to query your log group and group by event_type to get the count of events over time.
fields event_type | stats count() by event_type, bin(10m) would give you I suspect what you expect in the logs insights result pane, but doesn't allow visualization as a line chart, only as a bar chart - the line chart doesn't seem to support multiple lines according to the doc
There is an alternate solution, which involves using CloudWatch external data source queries: you can create a custom lambda that runs the Logs Insights query and returns multiple time series, this function can then be used with any visualization you like in any dashboard, including stacked lines, gauge, etc.
Relevant content
- asked 3 years ago
- AWS OFFICIALUpdated a year ago

Thanks - can you show me a query that would do that? I'm using CloudWatch Logs Insights, but I don't see how to group by event_type using this query language.