-
Notifications
You must be signed in to change notification settings - Fork 489
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Send to different Slack channels according to some criteria #195
Comments
This is possible but requires different alert nodes for each branch in the logic. var data = stream or batch ....
var data_a = data.where(lambda: "host" == 'A')
var data_b = data.where(lambda: "host" == 'B')
data_a.alert().slack().channel('A')
data_b.alert().slack().channel('B') |
Thanks Nat! I got a panic when I try to do as you wrote: panic: runtime error: slice bounds out of range goroutine 162 [running]: goroutine 1 [chan receive, 6 minutes]: goroutine 17 [syscall, 6 minutes, locked to thread]: goroutine 5 [syscall, 6 minutes]: goroutine 34 [IO wait]: goroutine 19 [select]: goroutine 15 [IO wait]: goroutine 16 [chan receive]: goroutine 41 [select]: goroutine 56 [chan receive, 6 minutes]: goroutine 57 [select]: goroutine 58 [select]: goroutine 59 [select]: goroutine 60 [select]: goroutine 61 [select]: goroutine 62 [select]: goroutine 63 [chan receive, 6 minutes]: goroutine 84 [select]: goroutine 85 [select]: goroutine 86 [select, 6 minutes]: goroutine 87 [chan receive, 6 minutes]: goroutine 88 [select, 6 minutes]: goroutine 89 [select, 6 minutes, locked to thread]: goroutine 114 [chan send, 5 minutes]: goroutine 132 [select]: goroutine 126 [chan receive]: goroutine 127 [select]: goroutine 128 [runnable]: goroutine 129 [runnable]: goroutine 163 [runnable]: goroutine 164 [select]: goroutine 165 [select]: goroutine 166 [chan receive]: |
Here is my task: var warnThreshold=80 var msg = '...' var data = batch var data1 = data.where(lambda: "host" == 'host1') var data2 = data.where(lambda: "host" != 'host1') data1 data2 |
@nhproject Can you try again? I fixed some issues with the where node. |
I installed the nightly debian - works good. |
Say I have two channels on Slack: Channel A, Channel B.
Channel A should receive all alerts that involves host A,
Channel B should receive all alerts that involves host B.
Can I do something like that on the .alert() node?
if eq (index .Tags "host") "A"
.slack()
.channel('A')
if eq (index .Tags "host") "B"
.slack()
.channel('B')
10x!
Nitz
The text was updated successfully, but these errors were encountered: