I have riemann code to trigger an email when both the condition were met . So I wrote a below code.
(let [email (mailer {....email configuration})]
(streams
(where (service "log")
(smap
(fn [events]
(let [count-of-failures (count (filter #(= "failed" (:Status %)) events) and (filter #(= "UK" (:Country %)) events))] ;Calculate the count for matched value
(event
{
:status "Failure"
:metric count-of-failures
:total-fail (>= count-of-failures 2)})))
(where (and (= (:status event) "Failure")
(:total-fail event))
(email "xxx@xx.com")
)prn))))
I am getting below error once I started to execute clojure.lang.ArityException: Wrong number of args (3) passed to:
Can anyone please suggest me a right way to use AND operation here.
Thanks in advance