HAProxy Enterprise Documentation 2.0r1

Use converters to perform database lookups

netacuity-lookup-ipv4

Use the converter netacuity-lookup-ipv4 to perform a lookup in the IPv4 database that returns the values of the specified properties. It can return several properties by specifying each successively; In that case, the returned values are separated by commas.

The maximum number of properties in one lookup is eight. Valid property types are:

  • src-ip (Note: This property shows the IP address of the client in IPv6 format.)

  • pulse-area-codes

  • pulse-city

  • pulse-city-code

  • pulse-city-conf

  • pulse-conn-speed

  • pulse-conn-type

  • pulse-continent-code

  • pulse-country

  • pulse-country-code

  • pulse-country-conf

  • pulse-gmt-offset

  • pulse-in-dst

  • pulse-internal-code

  • pulse-latitude

  • pulse-longitude

  • pulse-metro-code

  • pulse-postal-code

  • pulse-postal-conf

  • pulse-region

  • pulse-region-code

  • pulse-region-conf

  • pulse-timezone-name

  • pulse-two-letter-country

Syntax:

netacuity-lookup-ipv4(<prop>[,<prop>*])

In this example we set HTTP request headers that contain geolocation properties based on client's source IP address.

frontend www
    bind :80
    mode http
    http-request add-header X-NetAcuity-IPv4-1 %[src,netacuity-lookup-ipv4("src-ip","pulse-area-codes","pulse-city","pulse-city-code","pulse-city-conf","pulse-conn-speed","pulse-conn-type","pulse-continent-code")]
    http-request add-header X-NetAcuity-IPv4-2 %[src,netacuity-lookup-ipv4("pulse-country","pulse-country-code","pulse-country-conf","pulse-gmt-offset","pulse-in-dst","pulse-internal-code","pulse-latitude","pulse-longitude")]
    http-request add-header X-NetAcuity-IPv4-3 %[src,netacuity-lookup-ipv4("pulse-metro-code","pulse-postal-code","pulse-postal-conf","pulse-region","pulse-region-code","pulse-region-conf","pulse-timezone-name","pulse-two-letter-country")]

netacuity-lookup-ipv6

Use the converter netacuity-lookup-ipv6 to perform a lookup in the IPv6 database that returns the values of the specified properties. It can return several properties by specifying each successively; In that case, the returned values are separated by commas.

The maximum number of properties in one lookup is eight. Valid property types are:

  • src-ip (Note: This property shows the IP address of the client in IPv6 format.)

  • pulse-area-codes

  • pulse-city

  • pulse-city-code

  • pulse-city-conf

  • pulse-conn-speed

  • pulse-conn-type

  • pulse-continent-code

  • pulse-country

  • pulse-country-code

  • pulse-country-conf

  • pulse-gmt-offset

  • pulse-in-dst

  • pulse-internal-code

  • pulse-latitude

  • pulse-longitude

  • pulse-metro-code

  • pulse-postal-code

  • pulse-postal-conf

  • pulse-region

  • pulse-region-code

  • pulse-region-conf

  • pulse-timezone-name

  • pulse-two-letter-country

Syntax:

netacuity-lookup-ipv6(<prop>[,<prop>*])

In this example we set HTTP request headers that contain geolocation properties based on client's source IP address.

frontend www
    bind :80
    mode http
    http-request add-header X-NetAcuity-IPv6-1 %[src,netacuity-lookup-ipv6("src-ip","pulse-area-codes","pulse-city","pulse-city-code","pulse-city-conf","pulse-conn-speed","pulse-conn-type","pulse-continent-code")]
    http-request add-header X-NetAcuity-IPv6-2 %[src,netacuity-lookup-ipv6("pulse-country","pulse-country-code","pulse-country-conf","pulse-gmt-offset","pulse-in-dst","pulse-internal-code","pulse-latitude","pulse-longitude")]
    http-request add-header X-NetAcuity-IPv6-3 %[src,netacuity-lookup-ipv6("pulse-metro-code","pulse-postal-code","pulse-postal-conf","pulse-region","pulse-region-code","pulse-region-conf","pulse-timezone-name","pulse-two-letter-country")]

Next up

Update the database during runtime