Ok there is another complication I am trying to work out, in relation to this issue.
I have changed the code to merge the events coming from the same host using the following
(by :host
(rollup 0 15
(smap (fn [events] (reduce merge_events (peek events) (pop events)))
#(info %)
)
)
)
The merge_events function used in the reduce is shown below for reference
(defn merge_events
[e1 e2]
(assoc e1 :service (str (:service e1) "\n\t\t" (:service e2))
:metric (str (:metric e1) "\n\t\t" (:metric e2))
)
)
The problem I have now is that I have broken the streams per host using the '(by :hosts ...)' function and I would like to merge those streams together. The first rollup as shown above is used to merge the events from a single host. I would like to use the second rollup to limit the alerts I receive by email, so somehow I need to merge the streams from all hosts, and apply the rollup there. Any suggestion on how this can be achieved?
Thanks
Nick