- Basic filters
- Advanced filters
- Create dashboard filters
- Operators quick reference
- Save a filtered search
The Sensu dashboard includes basic filters you can use to build customized views of your Sensu resources. Sensu also supports advanced dashboard filtering based on a wider range of resource attributes and custom labels as a commercial feature.
When you apply a filter to a dashboard page, it creates a unique link for the filtered page. You can bookmark these links and share your favorite filter combinations.
Sensu includes these basic filters:
- Events page: filter by entity, check, status, and silenced/unsilenced.
- Entities page: filter by entity class and subscription.
- Checks page: filter by subscription and published/unpublished.
- Handlers page: filter by handler type.
- Filters page: filter by action.
- Silences page: filter by check and subscription.
You can also sort events and silences using the SORT dropdown menu:
- Events page: sort by last OK, severity, newest, and oldest.
- Silences page: sort by start date.
COMMERCIAL FEATURE: Access advanced filtering in the packaged Sensu Go distribution. For more information, see Get started with commercial features.
Sensu supports advanced dashboard filtering using a wider range of attributes, including custom labels. You can use the same methods, selectors, and examples for dashboard filtering as for API response filtering, with some syntax differences.
Create dashboard filters
If you are using the basic dashboard filters, you can create your filter just by clicking in the filter bar at the top of the dashboard page:
- In the dashboard, open the page of resources you want to filter.
- Click in the filter bar at the top of the dashboard page.
- Select the attribute you want to filter for from the dropdown list of options.
- Click in the filter bar again and select the filter to apply.
- Press Return/Enter.
NOTE: You do not need to specify a resource type in dashboard filtering because you must navigate to the resource page before you construct the filter.
To write a dashboard filter command:
SELECTORwith the selector you want to use:
FILTER_STATEMENTwith the filter to apply.
For example, this filter will return all events for entities with the
fieldSelector:linux in event.entity.subscriptions
Dashboard filtering statements will also work with a single space after the colon:
fieldSelector: linux in event.entity.subscriptions
Operators quick reference
Dashboard filtering supports two equality-based operators, two set-based operators, one substring matching operator, and one logical operator.
||Not included in.||
For details about operators, see API response filtering operators.
Filter with label selectors
To filter resources using custom labels (in this example, to display only resources with the
type label set to
labelSelector:type == server
To filter for entities that are labeled for any region in the US (e.g.
us-west-1, and so on):
labelSelector:region matches "us"
Filter with field selectors
To filter resources using specific resource attributes (in this example, to display only events at
2 (CRITICAL) status):
fieldSelector:event.check.status == "2"
On the Events page, to display only events for checks with the subscription
fieldSelector:webserver in event.check.subscriptions
On the Checks page, to display only checks that use the
fieldSelector:slack in check.handlers
Values with special characters
To use a label or field selector with string values that include special characters like hyphens and underscores, place the value in single or double quotes:
labelSelector:region == "us-west-1"
Use the logical AND operator
To use the logical AND operator (
&&) to return checks that include a
linux subscription and the
fieldSelector:linux in check.subscriptions && slack in check.handlers
Combine label and field selectors
fieldSelector filters, create the filters separately.
For example, to return resources with the
region label set to
us-west-1 that also use the
- Create the
labelSelectorfilter in the filter bar and press Return/Enter.
- Add the
fieldSelectorfilter in the filter bar after the
labelSelectorfilter and press Return/Enter again.
labelSelector:region == "us-west-1" fieldSelector:slack in check.handlers
Save a filtered search
COMMERCIAL FEATURE: Access saved filtered searches in the packaged Sensu Go distribution. For more information, see Get started with commercial features.
To save a filtered search:
- Create a dashboard filter.
- Click the save icon at the right side of the filter bar:
- Click Save this search.
- Type the name you want to use for the saved search.
- Press Return/Enter.
Any Sensu user with access to the namespace where you save the search will be able to recall it at any time.
Sensu saves your filtered searches to etcd in a resource named
Recall a saved filtered search
To recall a saved search, click the save icon in the filter bar and select the name of the search you want to recall.
You can combine an existing saved search with a new filter to create a new saved search. To do this, recall a saved search, add the new filter in the filter bar, and save the combination as a new saved search.
Delete a saved filtered search
To delete a saved search:
- Click the save icon in the filter bar:
- Click the delete icon next to the search you want to delete: