0

is there any way to retrieve the user client domain from the ALB access logs? from AWS documantation there is a 'domain_name' attribute but it is indicates the requested server domain rather than the client domain.

i know that in nginx there is a domain attribute which indicates the domain of the client, is there a way to retrieve client domain from the alb?.

Dev93
  • 93
  • 2
  • 13

1 Answers1

0

As you've pointed out, ALB access logs do not provide client's dns name. Instead they return:

  • client:port - The IP address and port of the requesting client.

Thus, to get the domain name of the client, you would have to parse the logs, and "manually" get the domain based on the IP. For example, if python is used, there is gethostbyaddr which can be useful in getting the domain name from an IP address.

Marcin
  • 215,873
  • 14
  • 235
  • 294