By using AWS re:Post, you agree to the Terms of Use

Questions tagged with CloudWatch Logs Insights

Sort by most recent

Browse through the questions and answers listed below or filter and sort to narrow down your results.

Cloudwatch Log Insights - Line Chart Issues

Hello :wave: We are trying to use Cloudwatch Logs together with Cloudwatch Log Insights to Query through application's logs and visualise the API usage by different consumers. A single log consists of fields such as: - consumer (api user) - controller (base endpoint on which the consumer made a request) - action (exact action on which someone sent a request) Sample entry could look like this (obviously it truncated for the sake of explaining the problem) ``` { consumer: 'test-app-1', controller: 'api/test-controller', action: 'test-action } ``` Now, I would like to find a way in which I can group this in a line chart, for example requests made to different controllers by the consumers over time or exact action requests by consumers over time. I am not sure how to write the query, if I am to be honest, as ``` filter @logStream = 'someLogStream' | fields @timestamp, @message | stats count() by consumer, controller, action ``` does not generate a line chart over time, and adding ``` filter @logStream = 'someLogStream' | fields @timestamp, @message | stats count() by consumer, controller, action, bin(15m) ``` does not change the error message on visualisation screen, which states that: >The data is not suitable for a line chart. Try a bar chart, or group your result by bin function. Can anyone advise on what should I do? For starters, requests over time per consumer would be a nice metric and I believe that once we get to that point, we will be able to modify it per action / per controller. I think that I lack proficiency in the Insights syntax to achieve what I want. Thanks!
asked 14 days ago