On 07/28/2016 07:28 AM, Elena wrote:
> Hi.
>
> I'm trying to send event to influxdb. I want to calculate time between events
> and sent the result event with this calculated metric to influxdb. I tryed
> 'with' and 'event' statements. This one returns me an error:
>
> WARN [2016-07-28 12:19:15,064] defaultEventExecutorGroup-2-1 - riemann.streams -
> riemann.config$eval41$new_fork__7980__auto____45$fn__47@1caf9e56 threw
> java.lang.ClassCastException: riemann.codec.Event cannot be cast to clojure.lang.IFn
> at riemann.config$test.invokeStatic(riemann.config:46)
>
> Can you help me to understand what I'm doing wrong?
> (fn [[event event']]
> (when-not (empty? event)
> (prn "changed from" (:time event) "to" (:time event') "diff" (- (:time event') (:time event)))
> (event {:service "test"
>
> :metric (- (:time event') (:time event))}
> influxBatchSender)))))))
You've named this function's parameter `event`, which means you're shadowing the
`riemann.core/event` function you're trying to call. You can drop the call to
`event` altogether (maps are already events), change the argument name, or use
the fully qualified function name.
--Kyle