SummarizeQuery example
- Last UpdatedApr 14, 2026
- 1 minute read
"How many events matched my filter, and what is the total/min/max cook time?"
SummarizeQueryEventsRequest {
Filters: [ EventFilter { Property: { PropertyId: "quantity", Operation: GreaterThan,
Value: 0, Uom: "count" } } ]
PropertiesToSummarize: [ SummarizeByProperty { PropertyId: "cooktime" } ]
}
Response:
SummaryResponse {
Summaries: [
ResourceSummary {
Count: 3 // total matching resources
PropertySummaries: [
PropertySummary {
Id: "cooktime"
Count: 3 // resources that had a numeric value for this property
Minimum: 600
Maximum: 1500
Average: 1100
Sum: 3300
Uom: "second" // TimeSpan properties are automatically converted
to seconds
}
]
}
]
}
Request structure
SummarizeQueryEventsRequest / SummarizeQueryEntitiesRequest
|
Field |
Type |
Required |
Description |
|---|---|---|---|
|
Filters |
repeated EventFilter / EntityFilter |
Yes |
Standard query filters. Same filter capabilities as Query. |
|
PropertiesToSummarize |
repeated SummarizeByProperty |
Yes |
One or more numeric properties to summarize. |
|
GroupByProperties |
repeated GroupByProperty |
No |
Group results by the distinct values of these properties. |
|
GroupByRelationships |
repeated GroupByRelationship |
No |
Group results by each relationship target. |
|
InRelationshipGroups |
map<string, Relationship> |
No |
Externally define groups by mapping a group key (such as a parent resource ID) to a relationship with the child resource IDs it covers. |
|
SubGraphId |
string (optional) |
No |
Restrict the operation to a subgraph. |
|
StartsAfter |
Timestamp (optional) |
No |
(Events only) Inclusive lower bound on event start time. Uses the same default as QueryEventsRequest. |
|
StartsBefore |
Timestamp (optional) |
No |
(Events only) Exclusive upper bound on event start time. Uses the same default as QueryEventsRequest. |
|
Context |
RequestContext (optional) |
No |
Standard request context. |