Handler per sevirity

Hey,

I am new with Kapacitor and I am trying to figure out how to set a different alert per sevirity.
i.e if info - slack, if warn - email + slack, if crit - pd + slack + email

my alert for example:
stream
|from()
.measurement(measurement)
.where(where_filter)
.groupBy(groups)
|window()
.period(window)
.every(window)
|mean(field)
|alert()
.info(info)
.warn(warn)
.crit(crit)
.slack()
.channel(slack_channel)

Thanks!

I think if you set your stream task to a variable, you can separate out the alerting handlers according to severity - there’s an example in this Github issue.

Hey, It doesn’t work, templates doesn’t support it.

Hi there @gaizeror,

In order to alert based on different severity levels, you will need to use Kapacitor topic handlers with a match condition, in your case, probably the level() function. Here’s a webinar/slideshare that can help you get started. Good luck!

@mschae16
Hey, yeah that’s what I have done eventually, I think it’s too messy that way, there must be a better solution

If you’re able to come up with one, we would love to hear about it!