Get your Better Stack source token for new or existing sources at Better Stack β Sources.
Explore documentation
Better Stack Amazon CloudWatch log forwarding
Start logging in 5 minutes
Forward logs from Amazon CloudWatch to Better Stack.
1. Create a new AWS Lambda
- Go to AWS Console β Lambda β Functions β Create function.
- Create a new Lambda function with these settings:
- Author from scratch
- Function name:
logtail-aws-lambda
- Runtime:
Node.js 18.x
- Architecture:
x86_64
2. Upload Better Stack AWS Lambda sources
- Download logtail-aws-lambda.zip archive with code source.
- Go to AWS Console β Lambda β Functions β logtail-aws-lambda.
- Select Upload from β .zip file and upload the
logtail-aws-lambda.zip
archive.
3. Configure Better Stack source token
- Switch to Configuration tab.
- Select Environment variables section.
- Add a new variable
BETTER_STACK_SOURCE_TOKEN
and paste your Better Stack source token as a value.
4. Set up subscription filters in CloudWatch
- Go to CloudWatch β Log groups.
- Open the log group you'd like to send to Better Stack.
- Switch to Subscription filters tab.
- Choose Create β Create Lambda subscription filter with these settings:
- Lambda function:
logtail-aws-lambda
- Log format:
JSON
- Subscription filter name:
logtail-aws-lambda-filter
- Lambda function:
You should see your logs in Better Stack β Live tail.
Need help?
Please let us know at hello@betterstack.com.
We're happy to help! π