Multiple Webhook

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

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}}" 
    }
  }
}

Thank you so much
It works...

But unfortunately, I faced with another problem:
image

I want to call an API from calling machine

    "numbers" : ["My_Number"],
    "department" :"alarm",
    "servername" : "Test",
    "problemdesc" : "error",

Can you share the watcher definition
I don't see any the tranformation you are doing, error sayd that field 'numbers' is unknow !

Yes
I had to put these parameters in "body"
Now the problem solved
Thanks alot

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.