Using ARM-based instances?
Use ARM log router image: betterstack/aws-ecs-fluent-bit:arm64-latest
.
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.{
"family": "your_ecs_task",
"containerDefinitions": [
{
"name": "your_app",
... Put your ECS app configuration here
"essential": true,
"logConfiguration": {
"logDriver": "awsfirelens"
}
},
{
"name": "log_router",
"image": "betterstack/aws-ecs-fluent-bit:amd64-latest",
"cpu": 256,
"memory": 512,
"memoryReservation": 50,
"essential": true,
"environment": [
{
"name": "LOGTAIL_SOURCE_TOKEN",
"value": "$SOURCE_TOKEN"
}
],
"firelensConfiguration": {
"type": "fluentbit",
"options": {
"config-file-type": "file",
"config-file-value": "/fluent-bit-logtail.conf",
"enable-ecs-log-metadata": "true"
}
}
}
],
"networkMode": "host",
... Put your ECS task configuration here
}
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.
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.