Sending slack msgs with custom event attributes - Part 2

59 views
Skip to first unread message

Matt

unread,
Sep 22, 2015, 2:06:52 PM9/22/15
to Riemann Users

I'm still trying to get this to work. I now get an exception when I try to format a custom event attribute.
Can you take a look at my code snippet and tell me where I screwed up?

def send-slack (slack credentials {:username "webhookbot"
                                :channel "#eventgen_notification"
                                :icon ":weary:"
                                :formatter (fn [e] {:log1 (:logfile1 e)})}))

                               
(streams
  (where (description #"Authorization failed")
      ;prn
      #(info %)
      (throttle 1 600:
      (with {:state "critical" :tag "riemann" }  #(info "AFTER- " %)  send-slack)
                               


INFO [2015-09-22 17:51:54,839] defaultEventExecutorGroup-2-1 - riemann.config - AFTER-  #riemann.codec.Event{:host docker-matt6-riemann.irbe, :service 058af25c-1dc5-45f4-a94f-cae9759c26aa, :state critical, :description Authorization failed - you can not get in here no matter how hard you try, :metric nil, :tags nil, :time 1442944314, :ttl nil, :tag riemann, :logfile1 mattlogfile.log}



INFO [2015-09-22 17:51:54,839] defaultEventExecutorGroup-2-1 - riemann.config - AFTER-  #riemann.codec.Event{:host docker-matt6-riemann.irbe, :service 058af25c-1dc5-45f4-a94f-cae9759c26aa, :state critical, :description Authorization failed - you can not get in here no matter how hard you try, :metric nil, :tags nil, :time 1442944314, :ttl nil, :tag riemann, :logfile1 mattlogfile.log}
WARN [2015-09-22 17:51:55,407] defaultEventExecutorGroup-2-1 - riemann.streams - riemann.slack$slack$fn__11037@3dfba9d6 threw
clojure.lang.ExceptionInfo: clj-http: status 500 {:orig-content-encoding nil, :trace-redirects ["https://hooks.slack.com/services/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"], :request-time 561, :status 500, :headers {"Connection" "Close", "Content-Length" "17", "X-Frame-Options" "SAMEORIGIN", "Strict-Transport-Security" "max-age=31536000; includeSubDomains; preload", "Server" "Apache", "Date" "Tue, 22 Sep 2015 17:51:55 GMT", "Content-Type" "text/html", "Access-Control-Allow-Origin" "*"}, :body "No text specified"}
        at clj_http.client$wrap_exceptions$fn__9677.invoke(client.clj:183)
        at clj_http.client$wrap_accept$fn__9829.invoke(client.clj:536)
        at clj_http.client$wrap_accept_encoding$fn__9835.invoke(client
Reply all
Reply to author
Forward
0 new messages