Forward AWS Elastic Load Balancer logs to Axiom for analysis using a Lambda function.
- Axiom account and API token
- AWS account with Lambda, S3, and ELB access
- ELB with access logging enabled
Via AWS Console:
- Go to ELB → Attributes
- Enable access logging
- Select S3 bucket
# See lambda_function.py for the code
pip install requests -t .
zip -r function.zip .
Environment variables:
AXIOM_API_TOKEN
AXIOM_DATASET_NAME
DATASET_NAME
Add S3 trigger:
- Select ELB logs bucket
- Event: ObjectCreated
Add to Lambda role:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"s3:GetObject"
],
"Resource": "arn:aws:s3:::your-elb-logs-bucket/*"
}
]
}
MIT