geo_parse(field value, keep=("country","province","city"), ip_sep=",")
Parameter Name | Parameter Description | Parameter Type | Required | Default Value | Parameter Value Range |
data | IP value. Separate multiple IPs by separator. | String | Yes | - | - |
keep | The field to be reserved | String | No | ("country","province","city") geo only supports returning the latitude and longitude of cities in the Chinese mainland. | - |
ip_sep | The number of the expression in the match result | String | No | - | - |
{{"ip":"101.132.57.150"}}
fields_set("result", geo_parse(v("ip")))
{{"ip":"101.132.57.150","result":"{\\"country\\":\\"China\\",\\"province\\":\\"Shanghai\\",\\"city\\":\\"Shanghai\\"}"}"result": {"country": "China", "province": "Guangdong", "city": "Dongguan", "provider": "China Mobile", "latitude": "23.027", "longitude": "113.758"}}
{"ip":"101.132.57.150,101.14.57.157"}
fields_set("result", geo_parse(v("ip"),keep="province,city",ip_sep=","))
{"ip":"101.132.57.150,101.14.57.157", "result":"{\\"101.14.57.157\\":{\\"province\\":\\"Taiwan\\",\\"city\\":\\"NULL\\"},\\"101.132.57.150\\":{\\"province\\":\\"Shanghai\\",\\"city\\":\\"Shanghai\\"}}"}
is_subnet_of(IP range list, IP)
Parameter Name | Parameter Description | Parameter Type | Required | Default Value | Parameter Value Range |
IP range list | IP range. Separate multiple IP ranges by comma. | String | Yes | - | - |
IP | The IP to be checked | String | Yes | - | - |
{"ip": "192.168.1.127"}
log_keep(is_subnet_of("192.168.1.64/26",v("ip")))
{"ip": "192.168.1.127"}
{"ip": "192.168.1.127"}
fields_set("is_subnet",is_subnet_of("192.168.1.64/26",v("ip")))
{"ip": "192.168.1.127", "is_subnet":"true"}
{"ip": "192.168.1.127"}
fields_set("is_subnet",is_subnet_of("172.16.0.0/16",v("ip")))
{"ip": "192.168.1.127", "is_subnet":"false"}
{"ip": "192.168.1.127"}
fields_set("is_subnet",is_subnet_of("172.16.0.0/16,192.168.1.64/26",v("ip")))
{"ip": "192.168.1.127", "is_subnet":"true"}
inet_aton(IP)
Parameter Name | Parameter Description | Parameter Type | Required | Default Value | Parameter Value Range |
IP | The IP address to be converted | String | Yes | - | - |
{"ip": "192.168.0.1"}
fields_set("ip_int", inet_aton(v("ip")))
{"ip_int":"3232235521","ip":"192.168.0.1"}
inet_ntoa(number)
Parameter Name | Parameter Description | Parameter Type | Required | Default Value | Parameter Value Range |
number | The integer to be converted to an IP address | int | Yes | - | - |
{"ip_int":"3232235521"}
fields_set("ip", inet_ntoa(v("ip_int")))
{"ip_int":"3232235521","ip":"192.168.0.1"}
Apakah halaman ini membantu?
Anda juga dapat Menghubungi Penjualan atau Mengirimkan Tiket untuk meminta bantuan.
masukan