-
I think I don't understand Reduce, because given the following, I expected to have an event whenever inputs = ["activity"]
type = "reduce"
ends_when = "to_float!(.count) == 10"
group_by = [
"name",
"node",
] This gets fed events of this shape {
"count": 1.0,
"name": "some-name",
"node": "some-node",
"timestamp": "2022-08-02T13:40:22.815Z"
} What I get instead is just an assortment of events with varying |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Beyond the examples on the documentation page, there's not much else. However, apropos to your particular example: the You could accomplish that style of reduction/flushing with the stateful |
Beta Was this translation helpful? Give feedback.
Beyond the examples on the documentation page, there's not much else.
However, apropos to your particular example: the
ends_when
condition is used to determine if an incoming event is one that should cause the reducer to emit the reduced event before the expiry period. In your example, it looks like you're trying to figure out when the accumulated.count
of your reduced events reaches 10, and to flush the reducer state for that grouping, but theends_when
condition only operates on the events coming in.You could accomplish that style of reduction/flushing with the stateful
lua
transform, butreduce
currently only supports the aforementioned behaviors (terminal event condition, expiry per…