# Webhook body format for threshold term value

**URL:** <https://discuss.elastic.co/t/webhook-body-format-for-threshold-term-value/287894>\
**Category:** SIEM\
**Created:** [October 28, 2021, 9:12am UTC](https://discuss.elastic.co/t/webhook-body-format-for-threshold-term-value/287894 "2021-10-28T09:12:22Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![lusynda](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lusynda/32/53557_2.png) [@lusynda](https://discuss.elastic.co/u/lusynda)\
**Post date:** [October 28, 2021, 9:12am UTC](https://discuss.elastic.co/t/webhook-body-format-for-threshold-term-value/287894/1 "2021-10-28T09:12:22Z")

</div>

Hi all.  
I've just created a webhooks to an internal services that will need to get the value as the result of the signal that a siem threshold rule will produce.  
Normally for email connector the body will look like this:

```auto
{{#context.alerts}}
{{#signal.threshold_result.terms}}{{value}}{{/signal.threshold_result.terms}}
{{/context.alerts}}

```

But will the format for webhook be the same?

Thanks you for ryour time.

---

<div class="post-metadata">

**Author:** ![christos.nasikas](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christos.nasikas/32/45611_2.png) [@christos.nasikas](https://discuss.elastic.co/u/christos.nasikas)\
**Post date:** [November 1, 2021, 10:41am UTC](https://discuss.elastic.co/t/webhook-body-format-for-threshold-term-value/287894/2 "2021-11-01T10:41:42Z")

</div>

Hi @lusynda,

Yes, context variables are supported by the webhook. It should work.

 ![Screenshot 2021-11-01 at 12.41.07 PM](https://us1.discourse-cdn.com/elastic/original/3X/4/8/482e38c02c9f3cf2bb5ae49f3e07bc5adfd38b6f.png)

Best,  
Christos

---

<div class="post-metadata">

**Author:** ![lusynda](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lusynda/32/53557_2.png) [@lusynda](https://discuss.elastic.co/u/lusynda)\
**Post date:** [November 2, 2021, 10:58am UTC](https://discuss.elastic.co/t/webhook-body-format-for-threshold-term-value/287894/3 "2021-11-02T10:58:51Z")

</div>

So will this

```auto
{
	"ip": "{{#context.alerts}}{{#signal.threshold_result.terms}}{{value}}{{/signal.threshold_result.terms}}{{/context.alerts}}"
}

```

become this:

```auto
{
	"ip": "192.168.0.1"
}

```

---

<div class="post-metadata">

**Author:** ![christos.nasikas](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christos.nasikas/32/45611_2.png) [@christos.nasikas](https://discuss.elastic.co/u/christos.nasikas)\
**Post date:** [November 2, 2021, 3:40pm UTC](https://discuss.elastic.co/t/webhook-body-format-for-threshold-term-value/287894/4 "2021-11-02T15:40:26Z")

</div>

I am not sure about the values of `signal.threshold_result.terms`. If it worked for your email connector it should work for the webhook connector.

Thanks,  
Christos

---

<div class="post-metadata">

**Author:** ![lusynda](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lusynda/32/53557_2.png) [@lusynda](https://discuss.elastic.co/u/lusynda)\
**Post date:** [November 10, 2021, 3:42am UTC](https://discuss.elastic.co/t/webhook-body-format-for-threshold-term-value/287894/5 "2021-11-10T03:42:12Z")

</div>

Thanks for your response.  
well the output is exactly what i want but in some case the output is concatenate like this:

```auto
{
    "ip": "192.168.0.1123.123.123.123"
}

```

Is there a way for each ip the webhook send the data separately

---

<div class="post-metadata">

**Author:** ![christos.nasikas](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christos.nasikas/32/45611_2.png) [@christos.nasikas](https://discuss.elastic.co/u/christos.nasikas)\
**Post date:** [November 10, 2021, 1:12pm UTC](https://discuss.elastic.co/t/webhook-body-format-for-threshold-term-value/287894/6 "2021-11-10T13:12:52Z")

</div>

Hi @lusynda,

Glad it worked!

I do not think is possible to send the data separately. But you can create a comma-delimited list by putting a comma after the `{{value}}`.

```auto
{
	"ip": "{{#context.alerts}}{{#signal.threshold_result.terms}}{{value}},{{/signal.threshold_result.terms}}{{/context.alerts}}"
} 

```

Although that will put a comma after the last item. I am not sure how you can avoid that. Maybe @gmmorris or @Patrick_Mueller can help.

Thanks,  
Christos

---

<div class="post-metadata">

**Author:** ![Patrick\_Mueller](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/patrick_mueller/32/109425_2.png) [@Patrick\_Mueller](https://discuss.elastic.co/u/Patrick_Mueller)\
**Post date:** [November 10, 2021, 6:59pm UTC](https://discuss.elastic.co/t/webhook-body-format-for-threshold-term-value/287894/7 "2021-11-10T18:59:55Z")

</div>

The suggestion of using a delimiter (for instance, using a space below) within the string, so you'd have the following, is I think the best we can do today.

```auto
{
    "ip": "192.168.0.1 123.123.123.123 "
}

```

We have an issue open to track adding some additional capabilities, that might allow you to render this as something like this:

```auto
{
    "ip": ["192.168.0.1", "123.123.123.123"], 
}

```

It would be great if you could provide your use case there, if it's not already covered by some of the comments in the issue: [[alerts] provide mustache functions for ease-of-use in transforming mustache variables · Issue #84217 · elastic/kibana · GitHub](https://github.com/elastic/kibana/issues/84217)

---

<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:** [December 8, 2021, 7:00pm UTC](https://discuss.elastic.co/t/webhook-body-format-for-threshold-term-value/287894/8 "2021-12-08T19:00:32Z")

</div>

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