Country code as X- Header

We’ve noticed that the F5 seems to know the country of visitors (presumably based on some IP lookup). Is there any way to get the F5 to pass the country code (e.g. “US” for U.S.A. or “DE” for Germany) to the web application as, e.g., an X-Country request header?

Take a look at the following wiki article on the whereis command:

https://devcentral.f5.com/wiki/iRules.whereis.ashx

All modern F5 BIG-IPs come loaded with a “Geo-IP” database, primarily used for GTM geo-loadbalancing functions, but that is also accessible using the above command.

Thanks, so all I would need to know is how to set an X-header based on this

whereis  country

variable.

The HTTP::header insert method will do that for you, and the name of the header is arbitrary. Example:

when HTTP_REQUEST {
    HTTP::header insert "X-Country" [whereis [IP::client_addr] country]
}