Does Cloudwatch deletes old log stream when Log Retention setting is changed?

Viewed 1346

I have very huge log groups (770GB). I added retention of 120 days to all log groups of my account. My question is, does older logs than 120 days will be deleted? Or I have to wait 120 days?

1 Answers

I could not find in the official documentation if log retention setting is retroactive but I just have tested it and when you specify or change the log retention setting it applies retroactively, so you do not need to wait 120 days to get deleted the logs, as soon as you apply the change, it deletes all the events that match the rule (events older than 120 days)

Test

Current retention setting: 7 days (appears logs from 18/02 - one week ago)

enter image description here

Changing the log retention to 5 days:

enter image description here

Immediately get deleted events older than 5 days (logs from 18/02 are not showed now): enter image description here

Consider that log events are deleted but log streams still appears and are listed but are empty

Related