Interpreting Load Balancer, WAF and Container Logs
This lesson explains how the application-level logs that the exam guide names, ELB access logs, AWS WAF logs, CloudFront logs and container logs, show what happened to requests above the IP layer.
Learning outcomes
After completing this lesson, you will be able to:
- Interpret ELB access and connection logs.
- Interpret WAF logs and container logs.
- Query logs with Athena.
ELB access and connection logs
ALB access logs, disabled by default, are delivered to an S3 bucket every five minutes; the bucket policy must allow the Elastic Load Balancing log delivery principal for the Region. Each entry contains the request time, client IP and port, target IP and port, request_processing_time, target_processing_time, response_processing_time, elb_status_code, target_status_code, bytes, request line, user agent, TLS cipher and protocol, target group ARN, trace ID and error reason fields. A value of -1 in a processing time or a dash for the target status means the load balancer could not complete the exchange with the target. Connection logs record TLS handshake details and client certificate information, and health check logs record each target check. NLB access logs record TLS connections only.
Reading access logs
WAF logs and container logs
AWS WAF logs show, for each inspected request, the terminatingRuleId, action, labels, rule group matches, rate-based rule details and the HTTP request headers, which explains why a client was blocked or challenged. Container logs from the awslogs driver or FireLens show application-level connection errors, such as DNS resolution failures for service discovery names, timeouts to dependencies or TLS errors, and ECS task network configuration in awsvpc mode gives each task its own ENI that appears in VPC Flow Logs. On EKS, CoreDNS logs and VPC CNI logs help with pod networking problems.
| Log | Destination | Shows |
|---|---|---|
| VPC Flow Logs | CloudWatch Logs, S3, Firehose | IP-level ACCEPT/REJECT per ENI |
| ALB access logs | S3 | Request timings and ELB/target status codes |
| AWS WAF logs | CloudWatch Logs, S3, Firehose | Terminating rule and action per request |
| CloudFront logs | CloudWatch Logs, S3, Firehose (v2); Kinesis (real time) | Edge result type, status, latency |
| Container logs | CloudWatch Logs (awslogs, FireLens, Fluent Bit) | Application connection errors |
| Resolver query logs | CloudWatch Logs, S3, Firehose | DNS queries and responses from VPCs |
504 errors only for one path
Users report timeouts on /reports/export. Athena queries over ALB access logs show elb_status_code 504 with target_processing_time of -1 and request durations of exactly 60 seconds, while other paths succeed. The ALB's idle timeout is 60 seconds and report generation takes up to 90. Container logs show the exports complete successfully after the ALB has already closed the connection. The team raises the idle timeout to 120 seconds for now and plans to make exports asynchronous.
Where are ALB access logs delivered?
Show answer
To an S3 bucket.
Exam Tips
Remember for the exam
- ALB access logs go to S3 and show ELB and target status codes and processing times.
- target_processing_time -1 and target status '-' mean the target did not respond in time.
- WAF logs show the terminating rule for blocked requests.
- Container logs reveal application-level DNS, timeout and TLS errors.