The advancedFilter
field lets you create complex filtering expressions that combine simple operations,
such as equals
, prefix
, and exists
, by using the Boolean operators and
, or
, and not
.
Filtering applies to basic fields as well as metadata. See the advancedFilter
syntax in the request example.
Leaf filter | Supported fields | Description and example |
---|---|---|
containsAll |
Array type fields | Only includes results which contain all of the specified values. {"containsAll": {"property": ["property"], "values": [1, 2, 3]}} |
containsAny |
Array type fields | Only includes results which contain at least one of the specified values. {"containsAny": {"property": ["property"], "values": [1, 2, 3]}} |
equals |
Non-array type fields | Only includes results that are equal to the specified value. {"equals": {"property": ["property"], "value": "example"}} |
exists |
All fields | Only includes results where the specified property exists (has a value). {"exists": {"property": ["property"]}} |
in |
Non-array type fields | Only includes results that are equal to one of the specified values. {"in": {"property": ["property"], "values": [1, 2, 3]}} |
prefix |
String type fields | Only includes results which start with the specified text. {"prefix": {"property": ["property"], "value": "example"}} |
range |
Non-array type fields | Only includes results that fall within the specified range. {"range": {"property": ["property"], "gt": 1, "lte": 5}} Supported operators: gt , lt , gte , lte |
search |
["name"] and ["description"] |
Introduced to provide functional parity with the /timeseries/search endpoint. {"search": {"property": ["property"], "value": "example"}} |
Property | Type |
---|---|
["description"] |
string |
["externalId"] |
string |
["metadata", "<someCustomKey>"] |
string |
["name"] |
string |
["unit"] |
string |
["unitExternalId"] |
string |
["unitQuantity"] |
string |
["instanceId", "space"] |
string |
["instanceId", "externalId"] |
string |
["assetId"] |
number |
["assetRootId"] |
number |
["createdTime"] |
number |
["dataSetId"] |
number |
["id"] |
number |
["lastUpdatedTime"] |
number |
["isStep"] |
Boolean |
["isString"] |
Boolean |
["accessCategories"] |
array of strings |
["securityCategories"] |
array of numbers |
and
and or
clauses must have at least one element (and at most 99, since each element counts
towards the total clause limit, and so does the and
/or
clause itself).property
array of each leaf filter has the following limitations:property
array must match one of the existing properties (static top-level property or dynamic metadata property).containsAll
, containsAny
, and in
filter values
array size must be in the range [1, 100].containsAll
, containsAny
, and in
filter values
array must contain elements of number or string type (matching the type of the given property).range
filter must have at lest one of gt
, gte
, lt
, lte
attributes.
But gt
is mutually exclusive to gte
, while lt
is mutually exclusive to lte
.gt
, gte
, lt
, lte
in the range
filter must be of number or string type (matching the type of the given property).search
filter value
must not be blank, and the length must be in the range [1, 128], and there
may be at most two search
filters in the entire filter query.value
of a leaf filter that is applied to a string property is 256.By default, time series are sorted by their creation time in ascending order.
Sorting by another property or by several other properties can be explicitly requested via the
sort
field, which must contain a list
of one or more sort specifications. Each sort specification indicates the property
to sort on
and, optionally, the order
in which to sort (defaults to asc
). If multiple sort specifications are
supplied, the results are sorted on the first property, and those with the same value for the first
property are sorted on the second property, and so on.
Partitioning is done independently of sorting; there is no guarantee of sort order between elements from different partitions.
In case the nulls
field has the auto
value, or the field isn't specified, null (missing) values
are considered bigger than any other values. They are placed last when sorting in the asc
order and first in the desc
order. Otherwise, missing values are placed according to
the nulls
field (last
or first
), and their placement won't depend on the order
field. Note that the number zero, empty strings, and empty lists are all considered
not null.
{
"sort": [
{
"property" : ["createdTime"],
"order": "desc",
"nulls": "last"
},
{
"property" : ["metadata", "<someCustomKey>"]
}
]
}
You can sort on the following properties:
Property |
---|
["assetId"] |
["createdTime"] |
["dataSetId"] |
["description"] |
["externalId"] |
["lastUpdatedTime"] |
["metadata", "<someCustomKey>"] |
["name"] |
["instanceId", "space"] |
["instanceId", "externalId"] |
The sort
array must contain 1 to 2 elements.
Response with a list of time series matching the specified criteria.
{- "filter": {
- "name": "string",
- "unit": "string",
- "unitExternalId": "string",
- "unitQuantity": "string",
- "isString": true,
- "isStep": true,
- "metadata": {
- "property1": "string",
- "property2": "string"
}, - "assetIds": [
- 363848954441724,
- 793045462540095,
- 1261042166839739
], - "assetExternalIds": [
- "my.known.id"
], - "rootAssetIds": [
- 343099548723932,
- 88483999203217
], - "assetSubtreeIds": [
- {
- "id": 1
}
], - "dataSetIds": [
- {
- "id": 1
}
], - "externalIdPrefix": "my.known.prefix",
- "createdTime": {
- "max": 0,
- "min": 0
}, - "lastUpdatedTime": {
- "max": 0,
- "min": 0
}
}, - "advancedFilter": {
- "or": [
- {
- "not": {
- "and": [
- {
- "equals": {
- "property": [
- "metadata",
- "manufacturer"
], - "value": "acme"
}
}, - {
- "in": {
- "property": [
- "name"
], - "values": [
- "pump-1-temperature",
- "motor-9-temperature"
]
}
}, - {
- "range": {
- "property": [
- "dataSetId"
], - "gte": 1,
- "lt": 10
}
}
]
}
}, - {
- "and": [
- {
- "equals": {
- "property": [
- "assetId"
], - "value": 1234
}
}, - {
- "equals": {
- "property": [
- "description"
], - "value": "Temperature in Celsius"
}
}
]
}
]
}, - "limit": 100,
- "cursor": "4zj0Vy2fo0NtNMb229mI9r1V3YG5NBL752kQz1cKtwo",
- "partition": "1/10",
- "sort": [
- {
- "property": [
- "string"
], - "order": "asc",
- "nulls": "first"
}
]
}
{- "items": [
- {
- "id": 1,
- "externalId": "string",
- "instanceId": {
- "space": "string",
- "externalId": "string"
}, - "name": "string",
- "isString": true,
- "metadata": {
- "property1": "string",
- "property2": "string"
}, - "unit": "string",
- "unitExternalId": "string",
- "assetId": 1,
- "isStep": true,
- "description": "string",
- "securityCategories": [
- 0
], - "dataSetId": 1,
- "createdTime": 1730204346000,
- "lastUpdatedTime": 1730204346000
}
], - "nextCursor": "string"
}