CloudWatch Logs retention setting leaves behind empty log streams

0

CloudWatch Logs retention setting leaves behind empty log streams. How do I configure CloudWatch Logs to deleted Log streams that are emptied because the logs contained within were deleted due to reaching retention age. I should not have to deploy additional Lambdas, or have to use the CLI or the console to delete these empty log streams.

asked 2 years ago1407 views
1 Answer
1

AWS may delete empty log streams that are over 2 months old. In the meantime, you'll have to delete the empty log streams and/or log group on your own. Here's a Lambda code to delete the empty log streams other than the ones whose naming start with "2018/10*". Do test the code and adjust to your specifications. I'd also advise to open an AWS Support Case requesting customization to delete empty log streams and voice your feedback.

AWS
EXPERT
Shree_C
answered 2 years ago
  • "AWS may delete empty log streams that are over 2 months old." - "may" ? What are the conditions ? My log streams are form 2021.

    "In the meantime, you'll have to delete the empty log streams and/or log group on your own." - As stated in the question, that is not what I'm looking for.

    "Here's a Lambda code" - explicitly stated as not wanted in the question.

    "I'd also advise to open an AWS Support Case" - Done, they replied: "This is a known limitation and is currently being tracked by the CloudWatch internal team. Please note we do have an existing feature request for this ability - I’ve added this case, and your specific use, as supporting evidence on the request."

  • You'll have to just wait for the feature release if you do not want to consider the other workarounds.

  • "This feature request was created in middle of 2019 as per the details on the feature request."

  • It's hard not to be cynical about things like this when support is all to ready to point me to implementing my own lambda based solution, meaning they are confident in the procedure that should be followed to achieve the desired outcome, but for some reason the product team can't do the same and save us all the development hassle and running expense. OR is it the running expense that AWS is keen to keep collecting?

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions