Add the ability to do global search by tags #9697

Open
opened 2025-12-29 21:21:11 +01:00 by adam · 3 comments
Owner

Originally created by @BrunoBlanes on GitHub (May 17, 2024).

NetBox version

v4.0.2

Feature type

New functionality

Proposed functionality

Add a field to select one or more tags and filter results by them, even when no query is given, and make it work with the existing search fields in a way that one could look up only objects that match all specified tags and are of a specific object type.
image

Use case

Tags are useful for sorting objects into categories, for example, I set the same tag to all objects that are allocated to a specific client, IP, Prefix, VLAN, etc., let's call that tag 13500, which represents the client's ID on my ERP. I currently have a couple of integrations which do use tags to identify objects.

By having the ability to search, globally, by tags, I can find the resources of said category faster, without the need to dive into every object menu.

The tags menu isn't that well invested and so it does not return much information about the object and does not allow me to filter by objects with multiple tags as parameter.

Database changes

None as far as I could guess since this is just a search and UI improvement, maybe some new indexing.

External dependencies

None.

Originally created by @BrunoBlanes on GitHub (May 17, 2024). ### NetBox version v4.0.2 ### Feature type New functionality ### Proposed functionality Add a field to select one or more tags and filter results by them, even when no query is given, and make it work with the existing search fields in a way that one could look up only objects that match all specified tags and are of a specific object type. ![image](https://github.com/netbox-community/netbox/assets/28227097/3134894d-03a6-4d77-82a1-56e5c1d05d3f) ### Use case Tags are useful for sorting objects into categories, for example, I set the same tag to all objects that are allocated to a specific client, IP, Prefix, VLAN, etc., let's call that tag `13500`, which represents the client's ID on my ERP. I currently have a couple of integrations which do use tags to identify objects. By having the ability to search, globally, by tags, I can find the resources of said category faster, without the need to dive into every object menu. The tags menu isn't that well invested and so it does not return much information about the object and does not allow me to filter by objects with multiple tags as parameter. ### Database changes None as far as I could guess since this is just a search and UI improvement, maybe some new indexing. ### External dependencies None.
adam added the type: featurecomplexity: mediumnetboxstatus: backlog labels 2025-12-29 21:21:11 +01:00
Author
Owner

@Mailstorm-ctrl commented on GitHub (May 20, 2024):

You might benefit more from custom fields than this functionality. Custom fields will achieve what you are wanting (search by value of custom field).

So what you'd do is create a custom field and assign it to whatever objects you want (or leave blank for everything). So you may do "Client Number" as the field name and then you just input whatever the client number is for that particular object.

However, the proper way to do this is to make a tenant (which I assume you are doing) for every client you have and assign the appropriate objects to that tenant. Then in that Tenant you'd have a custom field for the customer ID in your ERP. That way whenever you go to an object, you can just look at the tenant information then from there get the customer ID.

You'd have to change/modify your integrations but this is the way you'd want to do.

@Mailstorm-ctrl commented on GitHub (May 20, 2024): You might benefit more from [custom fields](https://docs.netbox.dev/en/stable/customization/custom-fields/) than this functionality. Custom fields will achieve what you are wanting (search by value of custom field). So what you'd do is create a custom field and assign it to whatever objects you want (or leave blank for everything). So you may do "Client Number" as the field name and then you just input whatever the client number is for that particular object. However, the proper way to do this is to make a tenant (which I assume you are doing) for every client you have and assign the appropriate objects to that tenant. Then in that Tenant you'd have a custom field for the customer ID in your ERP. That way whenever you go to an object, you can just look at the tenant information then from there get the customer ID. You'd have to change/modify your integrations but this is the way you'd want to do.
Author
Owner

@BrunoBlanes commented on GitHub (May 20, 2024):

That would solve the Client ID problem, but Tags can be used for much more than just that, for example, if I'd like to lookup all equipment that is allocated to clients under contract I'd have a tag for that, or IP addresses that are monitored via ICMP, I'd add a tag for that. And then you can start to mix and match tags for advanced filtering.

Tags are easier and more interactive than custom fields, which is not to say they don't have their own use case, for example, we use custom fields under Sites to register the Contract ID for each site with our local power supply company, so in case we have a power outage, we have the right info within Netbox.

@BrunoBlanes commented on GitHub (May 20, 2024): That would solve the Client ID problem, but `Tags` can be used for much more than just that, for example, if I'd like to lookup all equipment that is allocated to clients under contract I'd have a tag for that, or IP addresses that are monitored via ICMP, I'd add a tag for that. And then you can start to mix and match tags for advanced filtering. Tags are easier and more interactive than custom fields, which is not to say they don't have their own use case, for example, we use custom fields under `Sites` to register the Contract ID for each site with our local power supply company, so in case we have a power outage, we have the right info within Netbox.
Author
Owner

@ghost commented on GitHub (Jul 29, 2024):

@Mailstorm-ctrl , wouldn't custom fields not be ideal though? Tags can be applied to multiple objects, where-as a custom field has to be created for each object type, and the value inputted on each object type.

You'd have to have customer 13500 in a custom field on the VM object, on the site object, on the IP object, on the interface object, etc.
But a tag is one item that can be applied across all the objects mentioned. I agree that Tenant would be the better solution overall, but I don't see how custom fields would help.

@ghost commented on GitHub (Jul 29, 2024): @Mailstorm-ctrl , wouldn't custom fields not be ideal though? Tags can be applied to multiple objects, where-as a custom field has to be created for each object type, and the value inputted on each object type. You'd have to have customer 13500 in a custom field on the VM object, on the site object, on the IP object, on the interface object, etc. But a tag is one item that can be applied across all the objects mentioned. I agree that Tenant would be the better solution overall, but I don't see how custom fields would help.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#9697