Ability to search for MAC Address in new Global search #7344

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

Originally created by @ghost on GitHub (Dec 11, 2022).

Originally assigned to: @jeremystretch on GitHub.

NetBox version

v3.4-beta1

Feature type

New functionality

Proposed functionality

Please add the ability to search for MAC addresses. I thought this new global search was supposed to be able to search for anything within NetBox. Or maybe I've got it wrong, but I was really looking forward to being able to search for any value (either full or partial match) and have at least something returned.

If you search for a mac address (in any of the allowed formats, 00112233ffaa, 00:11:22:33:ff:aa, 00-11-22-33-ff-aa) you return zero results.
I have added several MAC addresses to virtual machine interfaces as a test. Then I search for this MAC's in the search box at the top. I always get zero results.

Use case

the ability to search for a MAC address is a huge time saver to find a device/interface.

Database changes

Honestly I'm unsure of what it takes in the database to allow this feature. As I understand it, the new search is a rebuild of the search function.

External dependencies

none that I am aware of.

Originally created by @ghost on GitHub (Dec 11, 2022). Originally assigned to: @jeremystretch on GitHub. ### NetBox version v3.4-beta1 ### Feature type New functionality ### Proposed functionality Please add the ability to search for MAC addresses. I thought this new global search was supposed to be able to search for anything within NetBox. Or maybe I've got it wrong, but I was really looking forward to being able to search for any value (either full or partial match) and have at least something returned. If you search for a mac address (in any of the allowed formats, 00112233ffaa, 00:11:22:33:ff:aa, 00-11-22-33-ff-aa) you return zero results. I have added several MAC addresses to virtual machine interfaces as a test. Then I search for this MAC's in the search box at the top. I always get zero results. ### Use case the ability to search for a MAC address is a huge time saver to find a device/interface. ### Database changes Honestly I'm unsure of what it takes in the database to allow this feature. As I understand it, the new search is a rebuild of the search function. ### External dependencies none that I am aware of.
adam added the type: bugstatus: acceptedbeta labels 2025-12-29 20:22:08 +01:00
adam closed this issue 2025-12-29 20:22:08 +01:00
Author
Owner

@kkthxbye-code commented on GitHub (Dec 11, 2022):

It think this makes sense and is probably an oversight, as the normal Interface model has MAC-address added to its search index.

For rererence this is the current SearchIndex for VirtualizationInterface:

2ad1db0c64/netbox/virtualization/search.py (L46-L51)

@kkthxbye-code commented on GitHub (Dec 11, 2022): It think this makes sense and is probably an oversight, as the normal Interface model has MAC-address added to its search index. For rererence this is the current SearchIndex for VirtualizationInterface: https://github.com/netbox-community/netbox/blob/2ad1db0c64f2e5e8876324da1411ed34c5e3fc45/netbox/virtualization/search.py#L46-L51
Author
Owner

@jeremystretch commented on GitHub (Dec 12, 2022):

Please add the ability to search for MAC addresses.

This already exists for device interfaces in v3.4-beta1, however it is missing for VM interfaces as @kkthxbye-code notes above. Note that you'll need to search using NetBox's canonical MAC address form (XX:XX:XX:XX:XX:XX).

@jeremystretch commented on GitHub (Dec 12, 2022): > Please add the ability to search for MAC addresses. This already exists for device interfaces in v3.4-beta1, however it is missing for VM interfaces as @kkthxbye-code notes above. Note that you'll need to search using NetBox's canonical MAC address form (`XX:XX:XX:XX:XX:XX`).
Author
Owner

@ghost commented on GitHub (Dec 12, 2022):

Will partial match work? any subset of the canonical MAC ?
11:22:AA:BB:DD:EE

11:22, or BB:DD, or DD:EE ?

@ghost commented on GitHub (Dec 12, 2022): Will partial match work? any subset of the canonical MAC ? 11:22:AA:BB:DD:EE 11:22, or BB:DD, or DD:EE ?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#7344