geo_parse(field value, keep=("country","province","city"), ip_sep=",")
Parameter | Description | Type | Required | Default Value | Value Range |
data | IP value. Separate multiple IPs by separator. | string | Yes | - | - |
keep | The field to be reserved | string | No | ("country","province","city") | - |
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\\"}"}
{"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 | Description | Type | Required | Default Value | 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"}
문제 해결에 도움이 되었나요?