amazon-cloudwatch-agent
amazon-cloudwatch-agent copied to clipboard
"retention_in_days" potentially does not work
Describe the bug CWA allows "retention_in_days" to be set for each item in the "collect_list". Example:
.
.
.
"logs_collected": {
"files": {
"collect_list": [
{
"file_path": "/tmp/foo",
"log_group_name": "MyLogGroup1",
"log_stream_name": "MyLogStreamFoo",
"retention_in_days": 14
},
{
"file_path": "/tmp/bar",
"log_group_name": "MyLogGroup1",
"log_stream_name": "MyLogStreamBar",
"retention_in_days": 14
}
]
}
},
.
.
.
However after translation to TOML only 1 of the log-files with have retention_in_days = 14
and the other will have retention_in_days = -1
.
If neither file gets created, or if the file with = 14
never actually gets created, the agent will not make the API call to set the retention for this log group.
Steps to reproduce Create a JSON config for the agent containing the snippet above.
What did you expect to see? I expected retention_in_days to get set for my log group.
Ideally, whenever the agent is started it should set the retention for the configured log groups regardless of whether files exist matching the file_paths.
What did you see instead? Retention was unchanged (default = never expire).
What version did you use?
v1.247352.0
What config did you use? See above
Environment OS: AL2
Additional context