awsdocs / elastic-beanstalk-samples

This repository contains code and configuration samples (e.g. .ebextensions) for AWS Elastic Beanstalk.
Apache License 2.0
1.22k stars 889 forks source link

Example for unified cloudwatch agent #150

Open rynop opened 3 years ago

rynop commented 3 years ago

Per the warning here, CloudWatch logs agent is going to be deprecated.

Can you please add an example for gathering application logs via the unified agent? The examples in the official docs are not great.

Specifically, I'd like to send multiple log files (/var/log/example/ex-1.log and /var/log/example/ex-2.log) to the same log group. Thanks in advance

JordanMontgomery commented 1 year ago

Has there been any movement on this or is there any supported way to use the unified cloudwatch agent on Amazon Linux 2 to gather custom logs? There are some hacky ways I've seen online but it seems like just dropping an extra config file for the unified agent to pickup doesn't work as expected, I assume because something related to Elastic Beanstalk's built in configuration interferes with that. Among other things this makes it difficult to switch to IMDSV2 since the current, documented solution only allows IMDSV1 and most things recommend disabling IMDSV1.