Search

Search is available on several features throughout sentry.io such as Issues and Discover.

Syntax

Search queries are constructed using a key:value pattern, with an optional raw search at the end. Each key:value pair is a token and the optional raw search is itself a single token. The key:value pair tokens are treated as issue or event properties. The optional raw search is treated as a single token and searches event titles/messages.

For example:

Copied
is:resolved user.username:"Jane Doe" server:web-8 example error

In the example above, there are three keys (is:, user.username:, server:), but four tokens:

  • is:resolved
  • user.username:"Jane Doe"
  • server:web-8
  • example error

The tokens is:resolved and user.username:"Jane Doe" are standard search tokens because both use reserved keywords. See Issue Properties and Event Properties for appropriate keyword usage. The token server:web-8 is pointing to a custom tag sent by the Sentry SDK. See Custom Tags for more information on how to set tags.

The token example error is utilizing the optional raw search and is passed as part of the issue search query (which uses a CONTAINS match similar to SQL). When using the optional raw search, you can provide one string, and the query uses that entire string.

Using OR and AND

Use OR and AND between tokens, and use parentheses () to group conditions. AND can also be used between non-aggregates and aggregates. However, OR cannot.

  • Non-aggregates filter data based on specific tags or attributes. For example, user.username:jane is a non-aggregate field.

  • Aggregates filter data on numerical scales. For example, count() is an aggregate function and count():>100 is an aggregate filter.

Some examples of using the OR condition:

Copied
# a valid `OR` query
browser:Chrome OR browser:Opera

# an invalid `OR` query
user.username:janedoe OR count():>100

Also, the queries prioritize AND before OR. For example, "x AND y OR z" is the same as "(x AND y) OR z". Parentheses can be used to change the grouping. For example, "x AND (y OR z)".

Multiple Values on the Same Key

You can search multiple values for the same key by putting the values in a list. For example, "x:[value1, value2]" will find the the same results as "x:value1 OR x:value2". When you do this, the search returns issues/events that match any search term.

An example of searching on the same key with a list of values:

Copied
release:[12.0, 13.0]

Currently, you can't use this type of search on the keyword is.

Explicit Tag Syntax

We recommend you never use reserved keywords (such as project_id) as tags. But if you do, you must use the following syntax to search for it:

Copied
tags[project_id]:tag_value

Advanced

Exclusion

By default, search terms use the AND operator; that is, they return the intersection of issues/events that match all search terms.

To change this, you can use the negation operator ! to exclude a search parameter.

Copied
is:unresolved !user.email:example@customer.com

In the example above, the search query returns all Issues that are unresolved and have not affected the user with the email address example@customer.com.

Wildcards

Search supports the wildcard operator * as a placeholder for specific characters and strings.

Copied
browser:"Safari 11*"

In the example above, the search query will match on browser values like "Safari 11.0.2", "Safari 11.0.3", etc.

You may also combine operators like so:

Copied
!message:"*Timeout"

In the above example, the search query returns results which do not have message values like ConnectionTimeout, ReadTimeout, etc.

Learn more

Help improve this content
Our documentation is open source and available on GitHub. Your contributions are welcome, whether fixing a typo (drat!) to suggesting an update ("yeah, this would be better").