Filter field
The filter field is a powerful tool that allows you to quickly find relevant information or narrow down results within apps.
- Filter statement: One complete filter statement that specifies your criteria.
- Key: The field or attribute you want to filter on.
- Comparator: Determines the type of comparison.
- Value: The specific value that you’re looking for.
- Logical operator: Connects multiple filter statements. By default, all filter statements are
AND
connected.
How to use filters
- To enter filter statements, type directly into the filter field or select from the suggested options.
- Depending on the filter field implementation, you can apply the filter:
- by making a change in the field (automatically)
- by selecting Apply
- by using the keyboard shortcuts: WindowsCtrl+Enter or macOSCmd+Enter
- To clear the entire filter field, select the
X
on the rightmost end of the field. - To remove an individual filter, hover over the filter statement and select the
X
for that statement.
Filter suggestions
To make things easier, the interface offers suggestions.
- As you type, relevant options are listed.
- Descriptions on the right side of the suggestion provide context.
- To apply a suggested option, select it (click or tap) in the list, or use the up and down arrow keys to navigate the list and then press Enter.
General syntax
- A space is a delimiter between keys, comparators, values, and filter statements.
- For numbers, use the decimal point
.
as a decimal separator. - For array fields, use the equals syntax
key = value
.
Comparators
Filter syntax
Description
Example
=
equals
key = value
!=
not equals
key != value
<
less than
key < value
<=
less than or equal to
key <= value
>
greater than
key > value
>=
greater than or equal to
key >= value
= *
has any value
key = *
!= *
doesn’t have a value
key != *
in
matches one or more values in a list of values
key in (value1, value2)
not in
doesn’t match one or more values in a list of values
key not in (value1, value2)
Logical operators
Filter syntax
Description
Example
AND
optional Both of the expressions must be true.
Note: AND
is optional because it's implicit between two expressions.
key = value key2 = value
Alternative:
key = value AND key2 = value
OR
One of the expressions must be true.
key = value OR key2 = value
Grouping filter statements
Use parentheses ( )
to group filter statements logically, such as key = value OR (key2 = value key3 = value)
.
Escaping values
Spaces, =
, <
, and >
are special characters in the filter field. Quotes and *
are also special characters when used at the start or end of a key or value. To use special characters as part of a value, you need to escape them.
Escape options:
-
Wrap the corresponding key or value in quotation marks. In the following example, the spaces between
Product
andName
, and betweenWidget
andA
, are escaped by wrapping the values in quotation marks."Product Name" = "Widget A"
-
Escape a single character with a backslash
\
. In the following example, the asterisk on the right end is escaped with a backslash.key = openshift-service-serving-signer@1677006647\*
.
Case sensitivity
String values are case-sensitive for all operators.
Wildcards
A wildcard matches any number of characters and is indicated by an asterisk (*
). Wildcards only work for values and outside of quotes.
Wildcard syntax
Description
key = *value
ends with value
key = value*
starts with value
key = *value*
contains value
Basic syntax
In some cases, crafting complex filter statements is not required. For this purpose, a slimmed-down, more focused version of the filter syntax is available. Filter fields with basic syntax don't support logical operators and grouping filter statements with brackets.
Translation to DQL
While the filter field provides a user-friendly interface, the Dynatrace Query Language (DQL) offers more advanced capabilities. For complex use cases, we recommend writing a custom DQL query. DQL allows you to harness additional features and fine-tune your queries beyond what the filter field provides.
Filter syntax
DQL
=
matchesValue(key, "value", caseSensitive: true)
!=
not matchesValue(key, "value", caseSensitive: true)
<
<
<=
<=
>
>
>=
>=
= *
isNotNull()
!= *
isNull()
in
key in (value1, value2)
in
not in
key not in (value1, value2)
not in
*value
matchesValue(key, "*value", caseSensitive: true)
value*
matchesValue(key, "value*", caseSensitive: true)
*value*
matchesValue(key, "*value*", caseSensitive: true)
The logical operators AND
and OR
are case insensitive. You can use and
and or
for the filter syntax and the DQL syntax.