Send logs to Better Stack from your AWS ECS cluster using FireLens and Fluent Bit.
Add Fluent Bit sidecar to your ECS task.
Elastic Container Service.Task definitions in the sidebar.Create a new revision with JSON button.
Use ARM log router image: betterstack/aws-ecs-fluent-bit:arm64-latest.
Deploy your task and you should see your logs in Better Stack β Live tail.
The latest images run Fluent Bit 1.9 on Amazon Linux 2. For Fluent Bit 5 on Amazon Linux 2023, use betterstack/aws-ecs-fluent-bit:amd64-3 or arm64-3 instead.
Set BETTER_STACK_MULTILINE_PARSER in the log_router environment to java, python or go to keep each stack trace in one log, or to several parsers separated by commas, such as java,python. The Fluent Bit 5 -3 images also accept ruby and json. Set it to partial_message instead to join long lines that Docker splits at 16 kB.
Add "user": "10001:10001", or any uid no other container uses, and "readonlyRootFilesystem": true to the log_router container to meet AWS Security Hub controls ECS.20 and ECS.5. It needs ECS agent 1.96.0 or later.
Please let us know at hello@betterstack.com.
We're happy to help! π
Want to read about ECS logging and FireLens configuration in more detail?
Check out the Amazon ECS Custom log routing docs page.
We use cookies to authenticate users, improve the product user experience, and for personalized ads. Learn more.