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.
Filters behave the same way as for the Filter events
endpoint.
In text properties, the values are aggregated in a case-insensitive manner.
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.
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.
Request aggregate to count the number of Events matching the filters. Default aggregate for the endpoint.
Response with a list of aggregation results.
The response for a bad request.
The response for too many requests (concurrency or rate throttling).
{- "aggregate": "count",
- "advancedFilter": {
- "or": [
- {
- "not": {
- "and": [
- {
- "equals": {
- "property": [
- "metadata",
- "severity"
], - "value": "medium"
}
}, - {
- "in": {
- "property": [
- "source"
], - "values": [
- "inspection protocol",
- "incident report"
]
}
}, - {
- "range": {
- "property": [
- "dataSetId"
], - "gte": 1,
- "lt": 10
}
}
]
}
}, - {
- "and": [
- {
- "equals": {
- "property": [
- "type"
], - "value": "equipment malfunction"
}
}, - {
- "equals": {
- "property": [
- "subtype"
], - "value": "mechanical failure"
}
}
]
}, - {
- "search": {
- "property": [
- "description"
], - "value": "outage"
}
}
]
}, - "filter": {
- "startTime": {
- "max": 0,
- "min": 0
}, - "endTime": {
- "max": 0,
- "min": 0
}, - "activeAtTime": {
- "max": 0,
- "min": 0
}, - "metadata": {
- "property1": "string",
- "property2": "string"
}, - "assetIds": [
- 1
], - "assetExternalIds": [
- "my.known.id"
], - "assetSubtreeIds": [
- {
- "id": 1
}
], - "dataSetIds": [
- {
- "id": 1
}
], - "source": "string",
- "type": "string",
- "subtype": "string",
- "createdTime": {
- "max": 0,
- "min": 0
}, - "lastUpdatedTime": {
- "max": 0,
- "min": 0
}, - "externalIdPrefix": "my.known.prefix"
}
}
{- "items": [
- {
- "count": 10
}
]
}