Understanding ALB access logs

Why Do We Need ALB Access Logs?

The first question that arises is, "Why do I need ALB access logs? Do they provide any additional information?" Well, perhaps the somewhat disheartening news is that even if you don't see an immediate need for ALB logs, they are the first thing that AWS support will ask you to provide if you encounter any issues with your ALB. Consequently, it's crucial to learn how to gather these logs so you can promptly send them to AWS. Nevertheless, ALB access logs are valuable, and understanding how they work is essential for utilizing them effectively!

In the previous post, I explained how to create an Amazon Athena table for ALB logs. This time, I will delve into the most crucial fields in Amazon ALB access logs.

The Most Important Fields in ALB Access Logs for Troubleshooting

  • request_processing_time -> Indicates how long it took for backend targets to process the request. The value can be -1 in two cases: if ALB can't send the request to the target or if the registered target didn't respond before the idle timeout.

  • target_processing_time -> Reflects the time taken by backend targets to process a request. This value can be -1 if the load balancer can't dispatch the request to a target. It may occur if the target closes the connection before the idle timeout or if the client sends a malformed request. This value can also be set to -1 if the target doesn't respond before the idle timeout.

  • client:port -> This field contains the IP and port of the client. If the client didn't send the full request, the value is set to -.

  • user_agent -> Provides information about the client's browser or user agent. This information can be useful for troubleshooting issues related to different user agents.

To find official documentation on all available fields, visit this link: ALB Access Log Entry Syntax

Conclusion

In conclusion, understanding the key fields in ALB access logs is pivotal for gaining actionable insights into your application's performance and security. Regularly analyzing these logs enables you to proactively address issues.

Did you find this article valuable?

Support Laurynas Tumosa by becoming a sponsor. Any amount is appreciated!