Skip to content

ThourayaBchir/ELB-logs-with-Axiom-and-Lambda

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Streaming AWS ELB Logs to Axiom via Lambda

Forward AWS Elastic Load Balancer logs to Axiom for analysis using a Lambda function.

Prerequisites

  • Axiom account and API token
  • AWS account with Lambda, S3, and ELB access
  • ELB with access logging enabled

Setup

1. Enable ELB Logging

Via AWS Console:

  • Go to ELB → Attributes
  • Enable access logging
  • Select S3 bucket

2. Deploy Lambda

# See lambda_function.py for the code

3. Configure Lambda

pip install requests -t .
zip -r function.zip .

Environment variables:

  • AXIOM_API_TOKEN
  • AXIOM_DATASET_NAME
  • DATASET_NAME

4. Set Up Trigger

Add S3 trigger:

  • Select ELB logs bucket
  • Event: ObjectCreated

5. IAM Permissions

Add to Lambda role:

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "s3:GetObject"
            ],
            "Resource": "arn:aws:s3:::your-elb-logs-bucket/*"
        }
    ]
}

License

MIT

About

Streaming AWS ELB Logs to Axiom via Lambda

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages