- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
How do I use regex all IPs in a subnet with the BloxOne DDI API?
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-13-2023 01:16 PM
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?
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-13-2023 02:36 PM
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 ]- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-13-2023 05:34 PM - edited 11-13-2023 05:37 PM
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?
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-08-2023 09:56 AM
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?
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-18-2023 09:30 AM
Try:
_filter=(address>='<START IP>' and address<='<END IP>')