- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
Search fqdn for regex not working
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-12-2020 02:36 AM
Hi,
I'm trying to use a regular expression to search the fqdn, but the regular expression doesn't appear to be working.
A simple working example:
$ curl -n "https://ipam.domain/wapi/v2.11.1/search?fqdn~=test-device&_return_fields=name" [ { "_ref": "record:host/......", "name": "test-device.domain" } ]
But, if I use ".est-device" instead of "test-device" (where the leading "." should match any single character, including "t") I get no results:
$ curl -n "https://ipam-uat.domain/wapi/v2.11.1/search?fqdn~=.est-device&_return_fields=name" []
Why is this simple regular expression fqdn search not working?
Re: Search fqdn for regex not working
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-12-2020 10:00 AM
Hi,
I tested this against my lab box which has WAPI version 2.10.5, and it appears to work correctly. Perhaps you could try to re-run the same curl command against your machine, but just change the version from 2.11.1 to 2.10.5 and see if it makes a difference? If it does, then you'd know it's a specific issue with 2.11.x.
Also, try use single quotes instead of double quotes around your URL, see if that makes a difference. (It did not make a difference on my system).
Re: Search fqdn for regex not working
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-12-2020 03:35 PM
Hi JKuo,
Thanks for your reply. Following your suggestion I tried with 2.10.5, single quotes (and various combinations), but I'm still not getting any results:
$ curl -n 'https://ipam-uat.domain/wapi/v2.10.5/search?fqdn~=.est-device&_return_fields=name' []
I originally encountered the problem accessing WAPI from python, and then reduced it back to the minimal curl example to which still demonstrates the problem.
Re: Search fqdn for regex not working
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-12-2020 05:42 PM
I cannot think of any reason why it wouldn't work... perhaps re-write the single dot in URL encoding (%2E)? I am not showing this behavior on my lab Grid.
Re: Search fqdn for regex not working
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-13-2020 03:53 PM
Using %2E didn't work either.
Your confirmation that it works on your infoblox server is helpful in that my query is probably correct, and it may be a problem with my infoblox instance.