Devices search via web is case insensitive yet it is case-sensitive via api #2802

Closed
opened 2025-12-29 18:22:18 +01:00 by adam · 3 comments
Owner

Originally created by @frebib on GitHub (Aug 10, 2019).

Environment

  • Python version: No idea
  • NetBox version: 2.5.13

Steps to Reproduce

  1. Create a device with a serial number
  2. Search web-ui with any case variant and always find the device
  3. Search for the device through the api and only find it when the exact same casing is used

Expected Behavior

Some way to find the find the device through the api with a case-insensitive lookup is a must.

We have a lot of servers and the information is sometimes entered by humans which means it's inconsistent and casing isn't always the same. It's unreasonable to perform multiple lookups for the same device, and even then that still only works if the case is all-lower or all-upper.

Observed Behavior

Only found the device when the exact same casing is used as is stored in the database

Originally created by @frebib on GitHub (Aug 10, 2019). <!-- NOTE: This form is only for reproducible bugs. If you need assistance with NetBox installation, or if you have a general question, DO NOT open an issue. Instead, post to our mailing list: https://groups.google.com/forum/#!forum/netbox-discuss Please describe the environment in which you are running NetBox. Be sure that you are running an unmodified instance of the latest stable release before submitting a bug report. --> ### Environment * Python version: No idea * NetBox version: 2.5.13 <!-- Describe in detail the exact steps that someone else can take to reproduce this bug using the current stable release of NetBox (or the current beta release where applicable). Begin with the creation of any necessary database objects and call out every operation being performed explicitly. If reporting a bug in the REST API, be sure to reconstruct the raw HTTP request(s) being made: Don't rely on a wrapper like pynetbox. --> ### Steps to Reproduce 1. Create a device with a serial number 2. Search web-ui with any case variant and always find the device 3. Search for the device through the api and only find it when the exact same casing is used <!-- What did you expect to happen? --> ### Expected Behavior Some way to find the find the device through the api with a case-insensitive lookup is a must. We have a lot of servers and the information is sometimes entered by humans which means it's inconsistent and casing isn't always the same. It's unreasonable to perform multiple lookups for the same device, and even then that still only works if the case is all-lower or all-upper. <!-- What happened instead? --> ### Observed Behavior Only found the device when the exact same casing is used as is stored in the database
adam added the status: acceptedtype: feature labels 2025-12-29 18:22:18 +01:00
adam closed this issue 2025-12-29 18:22:19 +01:00
Author
Owner

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

To clarify, the GUI and the API both use the same serial filter, which is case-sensitive. I assume you're using the general search function under the UI, which is actually the q filter (e.g. ?q=foo), which is case-insensitive and matches on much more than just the serial field.

What you want is to modify the serial filter to be case-insensitive.

@jeremystretch commented on GitHub (Aug 12, 2019): To clarify, the GUI and the API both use the same `serial` filter, which is case-sensitive. I assume you're using the general search function under the UI, which is actually the `q` filter (e.g. `?q=foo`), which is case-insensitive and matches on much more than just the serial field. What you want is to modify the `serial` filter to be case-insensitive.
Author
Owner

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

Will also update the serial filters for Rack and InventoryItem.

@jeremystretch commented on GitHub (Aug 12, 2019): Will also update the `serial` filters for Rack and InventoryItem.
Author
Owner

@frebib commented on GitHub (Aug 12, 2019):

Damn, thanks for the really quick response!

@frebib commented on GitHub (Aug 12, 2019): Damn, thanks for the really quick response!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#2802