Add IP-based filtering support when getting device information through API / Web-UI #11470

Closed
opened 2025-12-29 21:45:41 +01:00 by adam · 3 comments
Owner

Originally created by @dc881927 on GitHub (Aug 12, 2025).

NetBox version

4.1.7

Feature type

New functionality

Proposed functionality

Add support for primary_ip based searches in API/Web-UI, and it is an exact match, not a fuzzy match.

Use case

I use netbox as the network device and server information database. When I see the IP address of a device on another system, and when I go back to Netbox to find out what device it is, I find that searching by IP address is often inefficient. This is because I can only use the "q" field to search for an IP address. However, if I have, for example, 10.0.0.1 / 10.0.0.10 / 10.0.0.11 / 10.1.0.123 ...
I only search for 10.0.0.1, and a whole bunch of devices are returned, which is frustrating.

Database changes

No response

External dependencies

No response

Originally created by @dc881927 on GitHub (Aug 12, 2025). ### NetBox version 4.1.7 ### Feature type New functionality ### Proposed functionality Add support for primary_ip based searches in API/Web-UI, and it is an exact match, not a fuzzy match. ### Use case I use netbox as the network device and server information database. When I see the IP address of a device on another system, and when I go back to Netbox to find out what device it is, I find that searching by IP address is often inefficient. This is because I can only use the "q" field to search for an IP address. However, if I have, for example, 10.0.0.1 / 10.0.0.10 / 10.0.0.11 / 10.1.0.123 ... I only search for 10.0.0.1, and a whole bunch of devices are returned, which is frustrating. ### Database changes _No response_ ### External dependencies _No response_
adam added the type: feature label 2025-12-29 21:45:41 +01:00
adam closed this issue 2025-12-29 21:45:41 +01:00
Author
Owner

@ITJamie commented on GitHub (Aug 12, 2025):

most of our team have learnt to just add a / to the end of all ip searches to get an exact match. eg search 10.0.0.1/ instead of 10.0.0.1 which will give you a more accurate match.

I do agree its annoying at times. but it can also be useful to find a partial match

@ITJamie commented on GitHub (Aug 12, 2025): most of our team have learnt to just add a / to the end of all ip searches to get an exact match. eg search `10.0.0.1/` instead of `10.0.0.1` which will give you a more accurate match. I do agree its annoying at times. but it can also be useful to find a partial match
Author
Owner

@dc881927 commented on GitHub (Aug 13, 2025):

most of our team have learnt to just add a / to the end of all ip searches to get an exact match. eg search 10.0.0.1/ instead of 10.0.0.1 which will give you a more accurate match.

I do agree its annoying at times. but it can also be useful to find a partial match

Yes, that sounds like a good solution. However, it would be really nice to have a filter based on the primary_ip field.

@dc881927 commented on GitHub (Aug 13, 2025): > most of our team have learnt to just add a / to the end of all ip searches to get an exact match. eg search `10.0.0.1/` instead of `10.0.0.1` which will give you a more accurate match. > > I do agree its annoying at times. but it can also be useful to find a partial match Yes, that sounds like a good solution. However, it would be really nice to have a filter based on the primary_ip field.
Author
Owner

@jeremystretch commented on GitHub (Aug 14, 2025):

The q (search) filter is intentionally fuzzy. To filter using an exact match, use the address filter instead (e.g. /ipam/ip-addresses/?address=172.16.0.1).

@jeremystretch commented on GitHub (Aug 14, 2025): The `q` (search) filter is intentionally fuzzy. To filter using an exact match, use the `address` filter instead (e.g. `/ipam/ip-addresses/?address=172.16.0.1`).
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#11470