aws / aws-sdk

Landing page for the AWS SDKs on GitHub
https://aws.amazon.com/tools/
Other
73 stars 16 forks source link

aws cloudwatch logs filter pattern include lines before and/or after matching pattern #225

Closed HaithamMaya closed 6 months ago

HaithamMaya commented 4 years ago

Is there a way to include N lines before and/or after a matching pattern in AWS CloudWatch Logs?

Let's say I have this query and would like 3 lines before and after each match.

aws logs filter-log-events --log-group-name my-group --filter-pattern "mypattern"

The only work around I have at the moment is to remove the filter pattern and use grep:

aws logs filter-log-events --log-group-name my-group | grep -A 3 -B 3 mypattern

However, I would like to only stream the log events I need and do it as part of the aws log events query.

Ref: https://stackoverflow.com/questions/59217130/aws-cloudwatch-logs-filter-pattern-include-lines-before-and-or-after-matching-pa

jnguyen1098 commented 1 year ago

My team and I get burned by this every week and have to use raw timestamp ranges to get the context I need, completely wasting my team's annual spend for Lambdas that emit way too many logs at-scale. Would love to combime what grep has already been giving us for decades with CloudWatch's beautifully fluent query language 🥲

oguz-al commented 1 year ago

+1

andrey-berenda commented 1 year ago

+1

shinnawy commented 1 year ago

This will help tremendously for quick insights and queries 🙏

cn00 commented 1 year ago

+1

joaoagaccenture commented 1 year ago

+1

chrizee commented 1 year ago

+1

KartikShrivastava commented 12 months ago

+1

stephenc-dg commented 10 months ago

How is this not already implemented? Please give us two examples of higher priorities for the CloudWatch team than this.

Dsujan commented 9 months ago

Hi @kdaily, not sure if you are the right person but does the team have a timeline on this? This is a much-needed feature and is causing people whom I know to bail on Cloudwatch and have a full-blown ELK because they just cannot see the damn logs before the filter.

javierwilson commented 7 months ago

+1

tim-finnigan commented 6 months ago

Thanks all for your continued patience here. We have heard back from the CloudWatch team and were informed that this feature request was deprioritized for bandwidth on other higher priority features. The CloudWatch team is continuing to track this feature request in their backlog.

I have passed along all of the feedback in this issue to the CloudWatch team and they will reevaluate this for implementation in the future. I don't have any other news to share for now, so I will be closing this issue. Please keep an eye on our changelogs and blogs for updates.

github-actions[bot] commented 6 months ago

This issue is now closed.

Comments on closed issues are hard for our team to see. If you need more assistance, please either tag a team member or open a new issue that references this one. If you wish to keep having a conversation with other community members under this issue feel free to do so.

justinlawrence commented 6 months ago

Thanks all for your continued patience here. We have heard back from the CloudWatch team and were informed that this feature request was deprioritized for bandwidth on other higher priority features. The CloudWatch team is continuing to track this feature request in their backlog.

I have passed along all of the feedback in this issue to the CloudWatch team and they will reevaluate this for implementation in the future. I don't have any other news to share for now, so I will be closing this issue. Please keep an eye on our changelogs and blogs for updates.

Completed?!? Hardly.

blchilders commented 6 months ago

Thanks all for your continued patience here. We have heard back from the CloudWatch team and were informed that this feature request was deprioritized for bandwidth on other higher priority features. The CloudWatch team is continuing to track this feature request in their backlog. I have passed along all of the feedback in this issue to the CloudWatch team and they will reevaluate this for implementation in the future. I don't have any other news to share for now, so I will be closing this issue. Please keep an eye on our changelogs and blogs for updates.

Completed?!? Hardly.

There wasn't a .. our management is not liking the statistics from open issues status.

rwelch-dynata commented 5 months ago

coming from graphana and GCP, cloudwatch is painful and I hate it. Hilarious to see this opened in 2020 then closed 3 years later.

manibatra commented 3 months ago

Tedious to work without this feature. Coming from Loki lack of this feature seems like such a downgrade.