# Elastic webhook works sometimes and but sometimes fails

**URL:** <https://discuss.elastic.co/t/elastic-webhook-works-sometimes-and-but-sometimes-fails/356199>\
**Category:** Elastic Security\
**Created:** [March 26, 2024, 5:51pm UTC](https://discuss.elastic.co/t/elastic-webhook-works-sometimes-and-but-sometimes-fails/356199 "2024-03-26T17:51:11Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mmercaldi](https://avatars.discourse-cdn.com/v4/letter/m/a3d4f5/32.png) [@mmercaldi](https://discuss.elastic.co/u/mmercaldi)\
**Post date:** [March 26, 2024, 5:51pm UTC](https://discuss.elastic.co/t/elastic-webhook-works-sometimes-and-but-sometimes-fails/356199/1 "2024-03-26T17:51:11Z")

</div>

So I am trying to use elastic to launch an ansible task using webhook if a certain syslog message is received  
In curl, the command that works is

```auto
curl -s -k -u 'user:pass' -X POST -H 'Content-Type: application/json' -d '{"extra_vars":{"switchportinterface":"GigabitEthernet4/31"}}'
https://ansible.com`

```

however when I test this in webhook as an connector I have the body set as:

```auto
{
  "extra_vars": {
    "switchportinterface": "GigabitEthernet4/31"
  }
}

```

This fails with an option 400. Although once in a while this will succeed and launch the template. Any idea what changes I need to make?

---

<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 23, 2024, 5:51pm UTC](https://discuss.elastic.co/t/elastic-webhook-works-sometimes-and-but-sometimes-fails/356199/2 "2024-04-23T17:51:15Z")

</div>

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