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.

已提問 2 年前檢視次數 1422 次
1 個回答
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
專家
Shree_C
已回答 2 年前
  • "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?

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南