table.lookup_ip

IPtable.lookup_ipIDidSTRINGkeyIPdefault

Available inall subroutines.

Looks up the key key in the table id. When the key is present, its associated value will be returned. When the key is absent, the default value is returned. The default value is required.

Example

table overrides IP {
"/a": "203.0.113.0",
"/b": "203.0.113.1",
"/c": "203.0.113.2",
}
set client.geo.ip_override = table.lookup_ip(overrides, req.url.path, client.ip);