DataScript: avi.utils.get_geo_from_ip
DataScript
Function | avi.utils.get_geo_from_ip (ip_string, [flag]) |
Description | For a given IP address, returns a geolocation value from the geolocation database:
|
Events | All HTTP events |
Parameters | ip_string is a string containing the IP address for which geodatabase information is queried. flag is a string added in release 18.2.5. Starting in release 18.2.5 it can be set to "COUNTRY" or "ASN." |
Returns |
The database used for this function is equivalent to the default one maintained on the Avi Controller. It cannot be overridden or augmented with IP groups, as mentioned in the Geolocation Database article. To use this function, at least 100 MB of extra shared memory must be configured on the Service Engine group using it. This can be set via the "extra_shared_config_memory" parameter in the SE group, as illustrated below.
A restart of the SEs in this group is required for the memory changes to take effect. If this memory is not set, any virtual services configured with a DataScript using this function will be put into a fault state. In the Avi UI, the error message will resemble the below. |
Example | The below DataScript adds a geo header that looks like
|