The entity selector is a powerful instrument for specifying which entities you want to include in the scope of your Environment API v2 calls. It is used in several APIs, so you only have to learn the syntax once and then reuse it for multiple use cases.
You must specify one of following criteria:
Additionally you can provide the following criteria in any combination:
If you provide several criteria, only results matching all criteria are included in the response.
type(HOST),entityName.equals(Server)If the text input in the criteria contains certain symbols, such as parentheses or a comma, the text must be enclosed in quotation marks.
type(HOST),entityName.equals("Server(prod),1")The total length of the entitySelector string is limited to 2,000 characters.
You can select only one type of entity per query.
The type of the entity you want to query.
You can fetch the list of available entity types with the GET all entity types call.
Syntax |
|
Multiple values | |
Value operator |
|
Case-sensitive value |
The Dynatrace entity ID of the requested entity.
To specify several IDs, separate them by a comma (,). All requested entities must be of the same type.
You can fetch the list of available entities with the GET entities list call.
Syntax |
|
Multiple values | |
Value operator |
|
Case-sensitive value |
The name of the requested entity.
You can fetch the list of available entities with the GET entities list call.
Syntax |
|
Multiple values | |
Value operator |
|
Case-sensitive value |
Changes the value operator of the entity name criterion to BEGINS WITH.
Syntax |
|
Multiple values | |
Value operator |
|
Case-sensitive value |
Changes the value operator of the entity name criterion to EQUALS.
Syntax |
|
Multiple values | |
Value operator |
|
Case-sensitive value |
Enables you to provide multiple values for the entity name criterion.
Syntax |
|
Multiple values | |
Value operator |
|
Case-sensitive value |
By default entity names evaluation disregards the case. You can make the criterion stricter by using the caseSensitive modification. It takes any entity name criterion as an argument (including those already modified with .startsWith or .equals modifiers) and evaluates values as case-sensitive.
Syntax |
|
Multiple arguments |
The attribute name—attribute value pair that the requested entity should have.
To fetch the list of available attributes, execute the GET entity type call and check the properties field. You can use attributes with values that can be represented by a string.
Syntax |
|
Multiple values | |
Value operator |
|
Case-sensitive attribute name | |
Case-sensitive attribute value |
Changes the operator of the entity attribute criterion to EXISTS. In this case, the condition selects the entities that have the attribute, regardless of the attribute's value.
Syntax |
|
Operator |
|
The tag of the requested entities. Tags in [context]key:value, key:value, and value formats are detected and parsed automatically. If a value-only tag has a colon (:) in it, you must escape the colon with a backslash(\). Otherwise, the tag will be parsed as a key:value tag.
To specify several tags, separate them by a comma (,). An entity with any of the specified tags is included in the response.
You can fetch the list of available tags with the GET custom tags and the GET auto-tags calls.
Syntax |
|
Multiple values | |
Value operator |
|
Case-sensitive value |
The resource attributes of the requested entities. Use resourceAttributes("<key>") to select entities that report an attribute regardless of its value, or resourceAttributes("<key>:<value>") to select entities that report the attribute with a specific value.
To specify several attributes, separate them by a comma (,). An entity with any of the specified attributes is included in the response. You can specify up to 10 values in one resourceAttributes criterion, which is separate from the limit on how many resource attributes Dynatrace stores per entity—see Resource attribute limits and excluded keys.
Resource attribute keys depend on what OneAgent, Dynatrace Operator, and your own configuration report for an entity, so they vary by environment. To read the keys and values of a specific entity, use the GET an entity request; the GET entity type request lists resourceAttributes among the properties an entity of that type can have, but not the keys themselves. You can also check the Properties section of the entity page, as described in Where to see resource attributes.
Syntax |
|
Multiple values | |
Value operator |
|
Case-sensitive value |
A colon (:) separates the key from the value and can't be escaped inside a value. Only the text between the first and the second colon is matched, so you can't match a value that itself contains a colon—unlike the Tag criterion, where you escape a colon in a value with a backslash (\). To select entities by such an attribute, omit the value and match on the key alone.
The ID of the management zone to which the requested entities belong.
To specify several IDs, separate them by a comma (,).
You can fetch the list of available management zones with the GET all management zones call.
Syntax |
|
Multiple values | |
Value operator |
|
Case-sensitive value | n/a |
The name of the management zone to which the requested entities belong.
To specify several names, separate them by a comma (,).
You can fetch the list of available management zones with the GET all management zones call.
Syntax |
|
Multiple values | |
Value operator |
|
Case-sensitive value |
The health state of the requested entities. Possible values are HEALTHY and UNHEALTHY.
Syntax |
|
Multiple values | |
Value operator |
|
Case-sensitive value |
The timestamp (UTC milliseconds) when the entity was seen for the first time.
Syntax |
|
Multiple values | |
Value operator |
|
Case-sensitive value | n/a |
Include or exclude entities marked as deleted. Those are limited to the following entity types:
HTTP_CHECKSYNTHETIC_TESTEXTERNAL_SYNTHETIC_TESTMULTIPROTOCOL_MONITORAPPLICATIONMOBILE_APPLICATIONCUSTOM_APPLICATIONDCRUM_APPLICATIONCUSTOM_DEVICESyntax |
|
Operator |
|
Values | |
Example |
|
Note |
|
Relationships that the requested entity should have.
To fetch the list of available relationships, issue the GET entity type call and check the fromRelationships and toRelationships fields.
Syntax |
|
Multiple arguments | |
Note | Takes an entity selector as an attribute. |
You can use the not modification to invert any criterion except for type. It takes a criterion as an argument and inverts the condition. For example, the not(tag("Infrastructure:Linux")) criterion selects entities that do not have the Infrastructure:Linux tag.
You can use the negated criteria as part of complicated selectors, just like any other criteria.
Syntax |
|
Multiple arguments | |
Note | Doesn't support type criteria. |