Search missing prefixes #2738

Closed
opened 2025-12-29 18:21:35 +01:00 by adam · 7 comments
Owner

Originally created by @gfillol on GitHub (Jul 11, 2019).

Environment

  • Python version: 2.7.13
  • NetBox version: 2.5.13

Steps to Reproduce

  1. Add a new prefix : 10.200.0.0/24
  2. Add a new prefix : 10.200.2.0/24
  3. Search "10.200"

What did you expect to happen?

Search result show both 2 added prefixes 10.200.0.0/24 and 10.200.2.0/24

What happened instead?

Search result show only one prefix 10.200.0.0/24

Originally created by @gfillol on GitHub (Jul 11, 2019). ### Environment * Python version: 2.7.13 * NetBox version: 2.5.13 ### Steps to Reproduce 1. Add a new prefix : 10.200.0.0/24 2. Add a new prefix : 10.200.2.0/24 3. Search "10.200" ### What did you expect to happen? Search result show both 2 added prefixes 10.200.0.0/24 and 10.200.2.0/24 ### What happened instead? Search result show only one prefix 10.200.0.0/24
adam closed this issue 2025-12-29 18:21:35 +01:00
Author
Owner

@jeremystretch commented on GitHub (Jul 12, 2019):

This is not a bug. When searching by prefix, the provided ID is cast as a prefix. In this example, "10.200" is interpreted as "10.200.0.0", which is why 10.200.2.0 is not matched.

@jeremystretch commented on GitHub (Jul 12, 2019): This is not a bug. When searching by prefix, the provided ID is cast as a prefix. In this example, "10.200" is interpreted as "10.200.0.0", which is why 10.200.2.0 is not matched.
Author
Owner

@DanSheps commented on GitHub (Jul 12, 2019):

I could have swore this worked before, did this get changed recently? Would we maybe want to not cast it as a prefix?

Just checked this on an old v2.5.0, worked the same way then.

@DanSheps commented on GitHub (Jul 12, 2019): ~~I could have swore this worked before, did this get changed recently?~~ Would we maybe want to not cast it as a prefix? Just checked this on an old v2.5.0, worked the same way then.
Author
Owner

@gfillol commented on GitHub (Jul 15, 2019):

Add new :

  • prefix 10.200.0.0/24
  • prefix 10.200.2.0/24
  • IP address 10.200.0.1/24
  • IP address 10.200.2.0124

Then search "10.200", results are :

  • prefix 10.200.0.0/24
  • IP address 10.200.0.1/24
  • IP address 10.200.2.1/24

There you miss the prefix 10.200.2.0/24, and you get the IP address 10.200.2.1/24 which match the missed prefix.

Prefixes search behavior is not the same as IP addresses search, looks like a bug to me, at least confusing for user.

How to search all prefixes and IP addresses matching 10.200.*.* ?

Did this have to be a search functionality evolution ?

@gfillol commented on GitHub (Jul 15, 2019): Add new : - prefix 10.200.0.0/24 - prefix 10.200.2.0/24 - IP address 10.200.0.1/24 - IP address 10.200.2.0124 Then search "10.200", results are : - prefix 10.200.0.0/24 - IP address 10.200.0.1/24 - IP address 10.200.2.1/24 There you miss the prefix 10.200.2.0/24, and you get the IP address 10.200.2.1/24 which match the missed prefix. Prefixes search behavior is not the same as IP addresses search, looks like a bug to me, at least confusing for user. How to search all prefixes and IP addresses matching 10.200.*.* ? Did this have to be a search functionality evolution ?
Author
Owner

@LBegnaud commented on GitHub (Jul 15, 2019):

could you just search 10.200.0.0/22 or something larger?

@LBegnaud commented on GitHub (Jul 15, 2019): could you just search `10.200.0.0/22` or something larger?
Author
Owner

@gfillol commented on GitHub (Jul 16, 2019):

could you just search 10.200.0.0/22 or something larger?

"10.200.0.0/22" search response is :

  • no prefix
  • no IP address
  • 1 aggregate 10.200.0.0/22

"10.200.0.0/8" search response is : "no result found"

@gfillol commented on GitHub (Jul 16, 2019): > could you just search `10.200.0.0/22` or something larger? "10.200.0.0/22" search response is : - no prefix - no IP address - 1 aggregate 10.200.0.0/22 "10.200.0.0/8" search response is : "no result found"
Author
Owner

@jeremystretch commented on GitHub (Jul 16, 2019):

You want the "search within" field located directly below the general search field on the prefixes list. For example, ?within_include=10.200.0.0/22 will return all prefixes within 10.200.0.0/22 (as well as 10.200.0.0/22 itself, if it exists).

@jeremystretch commented on GitHub (Jul 16, 2019): You want the "search within" field located directly below the general search field on the prefixes list. For example, `?within_include=10.200.0.0/22` will return all prefixes within 10.200.0.0/22 (as well as 10.200.0.0/22 itself, if it exists).
Author
Owner

@gfillol commented on GitHub (Aug 8, 2019):

One search, two behaviors, depending if it applies to prefixes/aggregates or ip addresses.
Looks like a bug to me, but if you decide it is a "functionality" so it is.

@gfillol commented on GitHub (Aug 8, 2019): One search, two behaviors, depending if it applies to prefixes/aggregates or ip addresses. Looks like a bug to me, but if you decide it is a "functionality" so it is.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#2738