Farid_N
(Farid N)
March 14, 2021, 9:07am
1
Hi
I want to make an alert(watcher) with multiple action.
For example, I need to call more than two hosts(with different path and port) so I need to use my_webhook
according to the bellow page:
"actions" : {
"my_webhook" : {
"transform" : { ... },
"throttle_period" : "5m",
"webhook" : {
"method" : "POST",
"host" : "mylisteningserver",
"port" : 9200,
"path": ":/{{ctx.watch_id}}",
"body" : "{{ctx.watch_id}}:{{ctx.payload.hits.total}}"
}
}
}
But unfortunately, I faced with a Duplicate key "Webhook" error.
Here is the deal, how can I use "webhook" feature with two different destination?
1 Like
ylasri
(Yassine LASRI)
March 14, 2021, 10:36am
2
Try something like this
"actions" : {
"my_webhook_1" : {
"transform" : { ... },
"throttle_period" : "5m",
"webhook" : {
"method" : "POST",
"host" : "mylisteningserver",
"port" : 9200,
"path": ":/{{ctx.watch_id}}",
"body" : "{{ctx.watch_id}}:{{ctx.payload.hits.total}}"
}
},
"my_webhook_2" : {
"transform" : { ... },
"throttle_period" : "5m",
"webhook" : {
"method" : "POST",
"host" : "mylisteningserver",
"port" : 9200,
"path": ":/{{ctx.watch_id}}",
"body" : "{{ctx.watch_id}}:{{ctx.payload.hits.total}}"
}
}
}
Farid_N
(Farid N)
March 14, 2021, 11:28am
3
Thank you so much
It works...
But unfortunately, I faced with another problem:
I want to call an API from calling machine
"numbers" : ["My_Number"],
"department" :"alarm",
"servername" : "Test",
"problemdesc" : "error",
ylasri
(Yassine LASRI)
March 14, 2021, 1:44pm
4
Can you share the watcher definition
I don't see any the tranformation you are doing, error sayd that field 'numbers' is unknow !
Farid_N
(Farid N)
March 14, 2021, 2:37pm
5
Yes
I had to put these parameters in "body"
Now the problem solved
Thanks alot
system
(system)
Closed
April 11, 2021, 2:38pm
6
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.