# Searching and filtering

Many pages have filtering options and a search bar to narrow down which events
or resources are displayed.

When filters are manually chosen, search terms are automatically added to the
search bar in a `key:value` format. You may add "free" search terms or valid
key-value pairs to the search bar, including timestamps in the format
`yyyy-mm-dd hh:mm` or `yyyy-mm-dd`.

Free search terms are used in search as follows:

- For workloads, free search terms are searched for as substrings within the
  workload "location". For example, if you have a workload with a location
  aks-prod / bcloud-prod / bcloud, searching for bcloud-prod would return that
  workload, along with any others in the bcloud-prod namespace.
- For events, free search terms are searched for as substrings within the full
  name of the object that the event pertains to, which is displayed on the left
  side of an event, and the event description displayed on the right side of an
  event. For code rollout events, this includes version number.
- Note: when the "show event details" toggle is enabled, then the free search
  terms will _also_ be searched against the event details.

All search terms are implicitly ANDed together, _except_ when there are multiple
`key:value` terms where the key is the same, in which case those are implicitly
OR'd together. See the examples below. Search currently does not support
explicit "AND" or "OR" logical expressions.

## Workload Examples

- `cluster:prod cluster:staging` will return the list of workloads that are
  running in either the "prod" cluster _or_ the "staging" cluster.
- `namespace:linkerd cluster:prod` will return the list of workloads running in
  the prod cluster _and_ are in the Linkerd namespace.
- `namespace:linkerd cluster:prod cluster:staging` will return the list of
  workloads that are in the Linkerd namespace *and* run either in the "prod"
  cluster _or_ the "staging" cluster.

## Event Examples

- `type:alert type:rollout` will return a list of both alerts and rollout events
- `type:rollout env:prod` will return a list of rollout events that also have
  the tag env:prod
- `type:rollout env:staging env:prod` will return a list of events that are
  rollout events _and_ also have the tag env:prod _or_ the tag env:staging
