Reply

How do I use regex all IPs in a subnet with the BloxOne DDI API?

New Member
Posts: 2
4232     0

I have been trying to use a regex filter to find all addresses that begin with '10.10.10'. I keep getting errors such as 'no matches found' or 'an error has occurred', etc. One of the curls I have been trying to use is below. Has anyone had any luck? I have had luck using the == operator in the filter but for some reason no luck with regex. I have been referencing the following doc: https://csp.infoblox.com/apidoc/?url=https://csp.infoblox.com/apidoc/docs/Ipamsvc#/address

 

curl -H "Authorization: TOKEN token" 'base_url/ipam/address?_filter=address~^10\.10\.10\.'

 

However, even simpler regexs show up as 'no matches' so I am curious as to what I am doing wrong. Any help?

 

Re: How do I use regex all IPs in a subnet with the BloxOne DDI API?

Moderator
Moderator
Posts: 315
4233     0

I couldn't get it to work either.  I kept getting "An error has occurred..."  How about using lower and upper bounds instead?

 

https://csp.infoblox.com/api/ddi/v1/ipam/address?_filter=((address>="10.10.10.0")and(address<="10.10.10.255"))

 

 

 

Re: How do I use regex all IPs in a subnet with the BloxOne DDI API?

[ Edited ]
New Member
Posts: 2
4233     0
I currently have a program that filters by matching a pattern and that seems challenging to program in a meaningful way.

I literally just need to be able to filter on a pattern. If I put in 10.10 it should pull in anything that matches the first two octets and 10.10.10 matches first three and so on.

Is there no documentation on how to properly construct regexes or do we assume something is not right with the API itself?

Re: How do I use regex all IPs in a subnet with the BloxOne DDI API?

New Member
Posts: 3
4233     0

Try this:

 

_filter=(address>='<START IP>' and address<='<END IP>')

 

Re: How do I use regex all IPs in a subnet with the BloxOne DDI API?

New Member
Posts: 3
4233     0

Try:

_filter=(address>='<START IP>' and address<='<END IP>')

Showing results for 
Search instead for 
Did you mean: 

Recommended for You

Businesses are investing heavily into securing company resources from cyber-attacks form cybercrimin