-
|
I modeled my network sockets as devices but there are a lot of them and mostly i don't want to see them in the devices list. It is easy to find them by their type or their role. But now I want to exclude them from the display, in othetr words I want to negate the search query. How can I do this ? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
Hey @nklamann, There’s currently no option in the UI to invert filters directly, but you can still do this by using the same filter parameters that are available in the REST API and applying them as query parameters in the URL. For example, if you want to show only devices with the Device Role If instead you want to show all devices except those with the You can then create a “Saved Filter” for the object type {
"role_id__n": [
"4"
]
}Replace Hope this helps! |
Beta Was this translation helpful? Give feedback.
Hey @nklamann,
There’s currently no option in the UI to invert filters directly, but you can still do this by using the same filter parameters that are available in the REST API and applying them as query parameters in the URL.
For example, if you want to show only devices with the Device Role
Switch(database ID4), you can use:https://netbox_host/dcim/devices/?role_id=4If instead you want to show all devices except those with the
Switchrole (database ID4), you can use the__n(“not”) lookup:https://netbox_host/dcim/devices/?role_id__n=4You can then create a “Saved Filter” for the object type
DCIM > Devicewith parameters like:{ "role_id__n": [ "4" ] }Replace
4with the I…