EC2 Application Load Balancer: Identifying clients by user-agents

EC2 Application Load Balancer supports storing HTTP access logs in S3. (These logs can be further analyzed in Athena and QuickSight). It turns out the access logs capture the user-agent request header. So if you want to know which service is behind the HTTP request, adjust the user-agent header in the service.

Here's an example from an AWS Lambda written in Typescript.

import got from 'got' // https://github.com/sindresorhus/got
got('https://example.com', {
	headers: {
		'user-agent': `Service: foo`
	}
});

Would you like to connect? Subscribe via email or RSS , or follow me on Twitter!