Filter field

  • 6min

The filter field is a powerful tool that allows you to quickly find relevant information or narrow down results within apps.

Anatomy

Filter field component ini Dynatrace UI.

  1. Filter statement: Each gray section is one complete statement of a filter criteria.
  2. Key: The first part of the filter statement is the filter key or category.
  3. Comparison operator: Shows the type of comparison.
  4. Value: The specific value that you’re looking for.
  5. Logical operator: Connects multiple filter statements. AND will be used automatically unless you add OR.

How to use filters

  • To create a filter statement, simply start typing in the filter field. A dropdown with suggestions will immediately open.
  • Depending on the implementation, you can apply the filter:
    • By making a change in the filter field (dynamic filtering)
    • By selecting Apply (batched filtering)
    • By using the keyboard shortcuts: WindowsCtrl+Enter or macOSCmd+Enter
  • To clear the entire filter field, select the X at the right side of the field.
  • To remove an individual filter, hover over the filter statement and select the X for that statement.

Use filter suggestions

To make things easier for you, filter field offers relevant suggestions as you type.

  • Descriptions on the right side of the suggestion provide context.
  • To apply a suggestion, select it from the list (click or tap), or use the up and down arrow keys to navigate the list and then press Enter.

General syntax

  • Use a space as the separator, or delimiter, between keys, comparison operators, values, and filter statements.
  • For numbers, use a decimal point . as the decimal separator.
  • For arrays, use an equals sign key = value.
Note

Some features may not be available due to performance or data source limitations. For example, filter field generally supports wildcards (*) at either the beginning (ends-with) or end (starts-with) of a value. However, certain implementations, such as those based on the classic entity selector API, might not support the ends-with option.

Comparison operators

Filter syntax

Description

Example

=

equals

key = value

!=

doesn't equal

key != value

<

less than

key < value

<=

less than or equal to

key <= value

>

greater than

key > value

>=

greater than or equal to

key >= value

= *

is any value

key = *

!= *

isn't any value

key != *

in

matches one or more values in a list of values

key in (value1, value2)

not in

doesn’t match any value in a list of values

key not in (value1, value2)

Logical operators

Filter syntax

Description

Example

AND

Both expressions must be true. Note: You don't need to add AND. It is the default logical operator between any two expressions.

key = value key2 = value
Alternative:
key = value AND key2 = value

OR

Only one expression must be true.

key = value OR key2 = value

Grouping filter statements

Use parentheses () to group filter statements logically. For example, key = value OR (key2 = value key3 = value).

Escaping values

Space, *, ,, (, ), !, <, >, =, ", $, :, [, ], \, and ~ are special characters in the filter field. 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 and Name, and between Widget and A, 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. This means it isn't interpreted as a wildcard.

    key = openshift-service-serving-signer@1677006647\*.

Since backslash \ is also a special character, any backslash that appears in a value must also be escaped. Thus: path = C:\my\path must be written as path = C:\\my\\path.

Case sensitivity

String values are case-sensitive for all operators.

Wildcards

A wildcard will match any character in a value. Wildcards are indicated by an asterisk *.

Wildcard syntax

Description

key = *value

ends with any value

key = value*

starts with any value

key = *value*

contains any value

When a value contains special characters such as spaces, you must escape the value to ensure that it is correctly interpreted. In such cases, wildcards can be used outside or inside the escaped value. See examples below:

Suppose you want to filter for a service named "Payment Service". You would write the filter like this:

Name = "Payment Service"

This ensures that the entire string "Payment Service" is treated as a single value, including the space between "Payment" and "Service".

If you want to use wildcards with a value that contains spaces, you can do it like this:

Name = *"Payment Service"*

Or like this:

Name = "*Payment Service*"

This filter will match any service name that contains "Payment Service" anywhere within the name.

Basic syntax

In some cases, crafting complex filter statements isn't necessary. In such cases, a simpler, basic version of the filter syntax is provided. Filter fields with basic syntax don't support the logical OR or grouping filter statements with parentheses ().

Translation to DQL

While the filter field provides user-friendly filtering, Dynatrace Query Language (DQL) offers even more advanced capabilities. For complex use cases, we recommend writing a custom DQL query. DQL lets you use 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()

AND1

and1

OR1

or1

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)

1

The logical operators AND and OR are not case sensitive. You can also use and and or.