I need to write an aws cloudwatch query to create multiple line items in the same graph to represent task_path’s duration over time.
the logs are json in this format
{task_path: 'foo', duration: 1.48}
{task_path: 'bar', duration: 1.28}
{task_path: 'foo', duration: 1.18}
Was able to find the avg duration for a single task_path but when I add task_path in the aggregation, it doesn’t work. I need to plot a graph with all the task_paths over time bin.
here’s the query, which gives result for a single task_path, but I need a graph which can tell for every possible task_path.
fields @timestamp, duration, task_path
| filter task_path = "foo"
| stats avg(duration) by bin(5m)
Tried everything mentioned here but no luck, since I don’t need count, I need avg
Aggregate logs by field value and plot as multiple series using AWS CloudWatch Insights