Collecting AWS Access Logs with Datadog - ALB and CloudFront
For ALB and CloudFront access logs, you first have each service write them to S3 in its own settings, then trigger the Forwarder Lambda function with bucket notifications to send them to Datadog. You can let Datadog set up the triggers automatically or set them up yourself, and which to choose depends on whether you cross accounts or regions.
Comparing three access logs by destination and automatic collection support
As the way to send load balancer and CDN access logs to Datadog, the official documentation points to the Datadog Forwarder Lambda function. The Forwarder picks up logs that AWS services have written to an S3 bucket or a CloudWatch log group and sends them on. The Forwarder runs when triggered by S3 buckets, CloudWatch log groups, and EventBridge events. The procedure has three stages: deploy the Forwarder, enable logging, and set up triggers (as of October 2026; source: Send AWS Services Logs With The Datadog Lambda Function).
| AWS service | source tag | Destination | Automatic collection |
|---|---|---|---|
| Elastic Load Balancing (ELB) | source:elb | CloudWatch / S3 | Yes |
| CloudFront | source:cloudfront | CloudWatch / S3 | Yes |
| S3 (server access logs) | source:s3 | S3 | Yes |
The table shows automatic collection as available for all three. However, the ELB and CloudFront integration pages note that triggers can be set up automatically only for S3 buckets, and that log groups must be set up manually (source: Amazon Elastic Load Balancing). If you design on the premise that access logs go to S3, the automatic route is available. Deploying and updating the Forwarder itself is covered in the Datadog Forwarder glossary page, and why only logs take a separate path is explained in setting up the AWS integration.
First have the services write access logs to S3
Before running the Forwarder, the side producing the logs needs to be configured. ALB and Classic Load Balancer can write access logs to an S3 bucket, so enable logging in the load balancer settings and specify the bucket and prefix. For CloudFront, specify the S3 bucket for the logs in the distribution settings (as of October 2026; source: Amazon Elastic Load Balancing / Amazon CloudFront). For S3, select Enable in the Server access logging field under the bucket's Properties and choose the destination (source: Enabling Amazon S3 server access logging). Datadog's Amazon S3 integration page calls the same field Services Access Logging.
| Service | How to divide buckets | Reason given |
|---|---|---|
| ELB / ALB | A non-overlapping location per load balancer, or a separate prefix within the same bucket (example: my-bucket-for-elb-logs/my-elb-name) | Avoid ambiguous S3 event notification configurations |
| CloudFront | Consolidate logs from multiple distributions into the same bucket | Keep the Forwarder subscribed to just one bucket |
| CloudFront (S3 as origin) | Keep the origin bucket and the log bucket separate | Simpler maintenance |
ELB separates locations per load balancer while CloudFront consolidates into one bucket, so the advice seems to point in opposite directions. Both are recommendations for keeping the S3 notifications that invoke the Forwarder organized, and ELB logs can share the same bucket if separated by prefix. One way to proceed is to prepare a single bucket for access logs and give each load balancer and distribution its own prefix, which satisfies both recommendations.
Automatically created triggers only work within the same account and region
With the automatic setup, Datadog finds where the logs for the selected services are stored, adds them as Forwarder triggers, and keeps that list updated automatically. To set it up, select the account on the AWS integration page in Datadog and enter the Forwarder's ARN in the Datadog Forwarder Lambda field on the Log Collection tab. Then, under Log Sources in Log Autosubscription, enable the services you want to collect from. There are also Log Source Tag Filters for narrowing the targets by resource tags. Tags are normalized to lowercase, so write them in lowercase (as of October 2026; source: Send AWS Services Logs With The Datadog Lambda Function).
| Permission | Purpose |
|---|---|
| elasticloadbalancing:DescribeLoadBalancerAttributes | Get the name of the S3 bucket holding ELB access logs |
| cloudfront:GetDistributionConfig | Get the name of the S3 bucket holding CloudFront access logs |
| s3:GetBucketLogging | Get the name of the bucket holding S3 access logs |
| s3:PutBucketNotification | Add and remove Lambda triggers that run on S3 bucket events |
Add these permissions to the policy of the IAM role you have given Datadog for the AWS integration. The automatic setup cannot create triggers across accounts or regions. If your logs are in multiple regions, create a Forwarder in each region and add it to the same field. For setups where logs arrive in an S3 bucket in a different account, the official documentation recommends the workaround of creating triggers manually in the same account as the bucket.
To set triggers manually, point bucket notifications at the Forwarder
The manual setup is to open the Forwarder Lambda function in the AWS console, choose S3 from Add Trigger in the Function Overview, and specify the bucket that holds the logs. Leave the event type as All object create events and click Add (as of October 2026; source: Amazon CloudFront). Logs sent to CloudWatch log groups and buckets in other accounts take this route.
| Where the logs are | How to set the trigger |
|---|---|
| An S3 bucket in the same account and region as the Forwarder | Automatic (Log Autosubscription) or manual |
| An S3 bucket in a different region | Add a Forwarder in that region and use automatic, or manual |
| An S3 bucket in a different account | Manual, in the same account as the bucket |
| CloudWatch log groups (ELB / CloudFront) | Manual |
If you manage it as code, there is an example using Terraform's aws_s3_bucket_notification. An example using CloudFormation's NotificationConfiguration is on the same page (source: Send AWS Services Logs With The Datadog Lambda Function). Here is a shortened version of the Terraform example.
resource "aws_s3_bucket_notification" "access_logs" {
bucket = <bucket-name>
lambda_function {
lambda_function_arn = "<forwarder-arn>"
events = ["s3:ObjectCreated:*"]
}
}On the manual route, you set up each trigger yourself. When you add a log bucket, add the same steps or the same code each time.
CloudFront splits into separate paths for standard logs and real-time logs
CloudFront has two kinds of logs, and the official documentation also explains them in separate Standard Logs and Real-Time Logs tabs. Standard logs are written to an S3 bucket and arrive via the Forwarder trigger. Real-time logs are sent to a Kinesis Data Streams stream that you choose. The first route from there is to send them directly with Datadog's Kinesis Firehose integration. The other route is to drop them into S3 with a consumer such as Kinesis Data Firehose and then send them with the Forwarder (as of October 2026; source: Amazon CloudFront).
- Standard logs: CloudFront → S3 bucket → Forwarder trigger → Datadog
- Real-time logs (direct): CloudFront → Kinesis Data Streams → Kinesis Firehose integration → Datadog
- Real-time logs (via S3): CloudFront → Kinesis Data Streams → a consumer such as Data Firehose → S3 bucket → Forwarder → Datadog
When configuring real-time logs, you can choose which fields to receive, and all fields are selected by default. The official documentation recommends leaving this default as is and adding a helper rule. The place to add it is the Advanced Settings of the Grok Parser in the Amazon CloudFront pipeline under Pipelines, where you write a rule that reads all the fields. Here, we recommend starting with standard logs and adding real-time logs when you want to catch delivery anomalies sooner.
Distinguish incoming logs by source tag before sending them to parsing
Logs sent by the Forwarder get a per-service source tag. ELB logs get source:elb, CloudFront logs get source:cloudfront, and S3 access logs get source:s3, which you can use directly in Log Explorer searches. The value mapping is as shown in the table in Send AWS Services Logs With The Datadog Lambda Function (as of October 2026). CloudFront standard logs alone need care. If you set the file name prefix to cloudfront when enabling logging, they are classified under the CloudFront source; otherwise they are treated as s3 (source: Amazon CloudFront).
| Search | What to check |
|---|---|
| source:elb | Whether load balancer access logs are arriving |
| source:cloudfront | Whether distribution logs are classified as CloudFront |
| source:s3 | Whether CloudFront logs that are missing the prefix are mixed into the S3 access logs |
The source tag also serves as a key for selecting targets in the filter of the log pipeline, the entry point for parsing. The components inside it that extract and rewrite values are processors. Extracted values such as response codes and source IPs become axes for searching and aggregation as attributes. If you want to align how source is set with other logs collected by the Agent, you can apply the approach in setting up log collection.
Search for source:elb in Log Explorer to confirm ALB logs are arriving
Within a few minutes of the automatic setup, AWS logs appear in Log Explorer (as of October 2026; source: Send AWS Services Logs With The Datadog Lambda Function). If they do not appear, check from upstream down: the load balancer's log settings, then the Forwarder trigger, then the source. The IAM policy created by the Forwarder's CloudFormation includes KMS:Decrypt scoped to all resources. The official documentation says it can be removed once the installation has succeeded, so you can clean it up before a security review flags it.
- Write ALB access logs to S3 under a prefix dedicated to the load balancer
- Add the Forwarder's ARN on the Log Collection tab of the AWS integration and enable ELB
- Search for source:elb in Log Explorer
- If nothing arrives, check whether that bucket is in the Lambda's trigger list
How to store the incoming logs and how to think about costs are left to the Log Management explanation. The first task is to list the load balancers and distributions in your account and fill in, one entry at a time, whether the destination bucket and prefix for each one's logs overlap.