# Multiple Webhook

**URL:** <https://discuss.elastic.co/t/multiple-webhook/267178>\
**Category:** Kibana\
**Created:** [March 14, 2021, 9:07am UTC](https://discuss.elastic.co/t/multiple-webhook/267178 "2021-03-14T09:07:28Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Farid\_N](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/farid_n/32/74144_2.png) [@Farid\_N](https://discuss.elastic.co/u/Farid_N)\
**Post date:** [March 14, 2021, 9:07am UTC](https://discuss.elastic.co/t/multiple-webhook/267178/1 "2021-03-14T09:07:28Z")

</div>

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:

> **[Watcher webhook action | Elasticsearch Reference \[7.11\] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/actions-webhook.html)**

```auto
"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?

---

<div class="post-metadata">

**Author:** ![ylasri](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ylasri/32/86120_2.png) [@ylasri](https://discuss.elastic.co/u/ylasri)\
**Post date:** [March 14, 2021, 10:36am UTC](https://discuss.elastic.co/t/multiple-webhook/267178/2 "2021-03-14T10:36:08Z")

</div>

Try something like this

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

```

---

<div class="post-metadata">

**Author:** ![Farid\_N](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/farid_n/32/74144_2.png) [@Farid\_N](https://discuss.elastic.co/u/Farid_N)\
**Post date:** [March 14, 2021, 11:28am UTC](https://discuss.elastic.co/t/multiple-webhook/267178/3 "2021-03-14T11:28:36Z")

</div>

Thank you so much  
It works...

But unfortunately, I faced with another problem:  
 ![image](https://us1.discourse-cdn.com/elastic/original/3X/6/0/60d514f2494183e8c5e14a248ad45b6317f34798.png)

I want to call an API from calling machine

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

```

---

<div class="post-metadata">

**Author:** ![ylasri](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ylasri/32/86120_2.png) [@ylasri](https://discuss.elastic.co/u/ylasri)\
**Post date:** [March 14, 2021, 1:44pm UTC](https://discuss.elastic.co/t/multiple-webhook/267178/4 "2021-03-14T13:44:08Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Farid\_N](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/farid_n/32/74144_2.png) [@Farid\_N](https://discuss.elastic.co/u/Farid_N)\
**Post date:** [March 14, 2021, 2:37pm UTC](https://discuss.elastic.co/t/multiple-webhook/267178/5 "2021-03-14T14:37:58Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [April 11, 2021, 2:38pm UTC](https://discuss.elastic.co/t/multiple-webhook/267178/6 "2021-04-11T14:38:48Z")

</div>

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