i am running aws cloudwatch with pretty basic configuration, but it completely ignores the retention_in_days setting.
{
"agent": {
"metrics_collection_interval": 10,
"logfile": "/tmp/test.log"
},
"logs": {
"logs_collected": {
"files": {
"collect_list": [
{
"file_path": "/var/log/messages",
"log_group_name": "TEST",
"log_stream_name": "{instance_id}-{local_hostname}-/var/log/messages",
"retention_in_days": 30,
"timezone": "UTC"
}
]
}
}
}
}
Starting the agent like this:
sudo /opt/aws/amazon-cloudwatch-agent/bin/amazon-cloudwatch-agent-ctl -a fetch-config -s -c file:/tmp/config -m ec2
I can see the loggreap created and logstream inside it. Everything looks ok except that retention on the loggroup is set to never expire. I cant figure this one out. What is missing? Also tried downloading the latest agent just to make sure, but still doesnt work. Thanks