# Double embedded json and escaping quotes

**URL:** <https://discuss.elastic.co/t/double-embedded-json-and-escaping-quotes/174871>\
**Category:** Kibana\
**Created:** [April 1, 2019, 8:35pm UTC](https://discuss.elastic.co/t/double-embedded-json-and-escaping-quotes/174871 "2019-04-01T20:35:38Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Matt\_McGovern](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/matt_mcgovern/32/90131_2.png) [@Matt\_McGovern](https://discuss.elastic.co/u/Matt_McGovern)\
**Post date:** [April 1, 2019, 8:35pm UTC](https://discuss.elastic.co/t/double-embedded-json-and-escaping-quotes/174871/1 "2019-04-01T20:35:38Z")

</div>

I have a watcher that is using a webhook in an action where I have to send a json structure to the web destination. So this is embedded json where each double quote is escaped first like "

My problem is that inside that json struct, I have to send a href tag and I'm trying to figure out how to handle the double quotes there. I've tried a couple different ways to get around it, doubling the double-quotes, doubling the escape but not finding any solution.

---

<div class="post-metadata">

**Author:** ![nickpeihl](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nickpeihl/32/112622_2.png) [@nickpeihl](https://discuss.elastic.co/u/nickpeihl)\
**Post date:** [April 1, 2019, 10:25pm UTC](https://discuss.elastic.co/t/double-embedded-json-and-escaping-quotes/174871/2 "2019-04-01T22:25:44Z")

</div>

Maybe you can use the [`{{#toJson}}` function](https://www.elastic.co/guide/en/elasticsearch/reference/6.7/search-template.html#_converting_parameters_to_json) to escape the payload as seen in the [second example here](https://www.elastic.co/guide/en/elastic-stack-overview/6.7/actions-webhook.html).

---

<div class="post-metadata">

**Author:** ![Matt\_McGovern](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/matt_mcgovern/32/90131_2.png) [@Matt\_McGovern](https://discuss.elastic.co/u/Matt_McGovern)\
**Post date:** [April 3, 2019, 6:52pm UTC](https://discuss.elastic.co/t/double-embedded-json-and-escaping-quotes/174871/3 "2019-04-03T18:52:22Z")

</div>

After trying a number of variations on this, I've come to the understanding that the API that I'm sending to is stripping out any html rendering.

I appreciate the information about the #toJson and #url functions in the mustache template. Is there a list of factory-installed functions like those two that come with kibana's implementation of mustache?

---

<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:** [May 1, 2019, 6:52pm UTC](https://discuss.elastic.co/t/double-embedded-json-and-escaping-quotes/174871/4 "2019-05-01T18:52:23Z")

</div>

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