Reputation: 1251
As we know we can put something like this in awslogs.conf
file:
[/var/log/mylog]
file = /var/log/mylog.log
log_group_name = mylog
log_stream_name = mystream
datetime_format = %Y-%m-%dT%H:%M:%S.%f
What other parameters can we set in this file? I am looking to set the log retention days - is it possible?
Upvotes: 12
Views: 8113
Reputation: 3007
The awslogs.conf
file contains settings for the agent process, which is responsible for putting your log files into CloudWatch Logs. Managing the underlying log groups is out of the scope of it's responsibilities.
Assuming that the log group is created in the user-data
script (comments), you could add an additional command for setting the retention period there:
aws logs put-retention-policy --log-group-name mylog --retention-in-days 7
Upvotes: 12