IP range matcher plugin
![farhanromli](https://us.v-cdn.net/6038231/uploads/Dataiku/nAvatar2.png)
Is it possible to use variable in the IP range plugin?
I am getting an error when I am trying to do so (Refer attached)
I need to compare individual ip address against a long list of IP range so I was thinking of capturing the list in a variable and pass through the variable in the step but the step does not seem to work with variable
Operating system used: Windows 10
Answers
-
Turribeach Dataiku DSS Core Designer, Neuron, Dataiku DSS Adv Designer, Registered, Neuron 2023 Posts: 1,876 Neuron
On a formula processor you would add a variable using variables["my_var"]. However this is a plugin so this would only work if the plugin supports it which in this case it doesn't. So you would either need to modify the plugin or move to a Python recipe and use the built-in ipaddress IPv4/IPv6 manipulation library:
-
I see, so not all plugin support variables. Thanks for the info.
Currently, I would need to check against a range in the format of "IPa-IPx" such as '10.0.0.1-10.0.0.2' but the ipaddress module can only be used for CIDR. I am looking into using socket and struct library to convert the ip into integers and compare them
-
Turribeach Dataiku DSS Core Designer, Neuron, Dataiku DSS Adv Designer, Registered, Neuron 2023 Posts: 1,876 Neuron
You can convert any IP Range to CIDR, just use any of the free websites around:
https://www.ipaddressguide.com/cidr
CIDR is the standard way to specify IP ranges.