Aggregate events

The aggregation API lets you compute aggregated results on events, such as getting the count of all Events in a project, checking different descriptions of events in your project, etc.

Aggregate filtering

Filter (filter & advancedFilter) data for aggregates

Filters behave the same way as for the Filter events endpoint. In text properties, the values are aggregated in a case-insensitive manner.

aggregateFilter to filter aggregate results

aggregateFilter works similarly to advancedFilter but always applies to aggregate properties. For instance, in an aggregation for the source property, only the values (aka buckets) of the source property can be filtered out.

Request throttling

This endpoint is meant for data analytics/exploration usage and is not suitable for high load data retrieval usage.
The Aggregates endpoint, as with all endpoints in the Events API, is subject to a request budget that applies limits to both request rate and concurrency. Please check Events resource description for more information.

Securityoidc-token or oauth2-client-credentials or oauth2-open-industrial-data or oauth2-auth-code
Request
Request Body schema: application/json
One of:

Request aggregate to count the number of Events matching the filters. Default aggregate for the endpoint.

aggregate
string

Type of aggregation to apply. count: Get an approximate number of Events matching the filters.

Value: "count"
(BoolFilter (and (object) or or (object) or not (object))) or (LeafFilter (equals (object) or in (object) or range (object) or prefix (object) or exists (object) or containsAny (object) or containsAll (object) or search (object))) (EventAdvancedFilter)

A filter DSL (Domain Specific Language) to define advanced filter queries.

See more information about filtering DSL here.

Supported properties:

Property Type
["assetIds"] array of [number]
["createdTime"] number
["dataSetId"] number
["endTime"] number
["id"] number
["lastUpdatedTime"] number
["startTime"] number
["description"] string
["externalId"] string
["metadata"] string
["metadata", "someCustomKey"] string
["source"] string
["subtype"] string
["type"] string

Note: Filtering on the ["metadata"] property has the following logic: If a value of any metadata keys in an event matches the filter, the event matches the filter.

object (EventFilter)

Filter on events filter with exact match

Responses
200

Response with a list of aggregation results.

400

The response for a bad request.

429

The response for too many requests (concurrency or rate throttling).

post/events/aggregate
Request samples
application/json
{
  • "aggregate": "count",
  • "advancedFilter": {
    • "or": [
      ]
    },
  • "filter": {
    • "startTime": {
      },
    • "endTime": {
      },
    • "activeAtTime": {
      },
    • "metadata": {
      },
    • "assetIds": [
      ],
    • "assetExternalIds": [
      ],
    • "assetSubtreeIds": [
      ],
    • "dataSetIds": [
      ],
    • "source": "string",
    • "type": "string",
    • "subtype": "string",
    • "createdTime": {
      },
    • "lastUpdatedTime": {
      },
    • "externalIdPrefix": "my.known.prefix"
    }
}
Response samples
application/json
{
  • "items": [
    • {
      }
    ]
}