Beanstalk logs not forwarded to cloudwatch configured and installed on Amazon Linux 2023

0

I am using a custom config file to forward logs from ec2 to cloud watch but it is creating log stream with no data, can anyone suggest if anything is missing in the config file or any additions required.

packages: yum: amazon-cloudwatch-agent: []

files: "/etc/awslogs/awscli.conf" : mode: "000600" owner: root group: root content: | [plugins] cwlogs = cwlogs [default] region = {"Ref":"AWS::Region"}

"/etc/awslogs/awslogs.conf" : mode: "000600" owner: root group: root content: | [general] state_file = /var/lib/awslogs/agent-state

"/opt/aws/amazon-cloudwatch-agent/etc/custom.json": mode: "000600" owner: root group: root content: | { "logs": { "logs_collected": { "files": { "collect_list": [ { "file_path": "/var/log/tomcat9/catalina.out", "log_group_name": "{"Fn::Join":["/", ["/aws/elasticbeanstalk", { "Ref":"AWSEBEnvironmentName" }, "var/log/tomcat9/catalina.out"]]}", "log_stream_name": "{instance_id}" } ] } } } } commands: "091": command: sudo systemctl enable amazon-cloudwatch-agent.service "092": command: sudo /opt/aws/amazon-cloudwatch-agent/bin/amazon-cloudwatch-agent-ctl -a append-config -m ec2 -c file:/opt/aws/amazon-cloudwatch-agent/etc/custom.json -s "093": command: sudo systemctl restart amazon-cloudwatch-agent

Keine Antworten

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen