# Watcherのwebhookのbodyの設定方法について

**URL:** <https://discuss.elastic.co/t/watcher-webhook-body/211064>\
**Category:** 日本語による質問・議論はこちら\
**Created:** [December 9, 2019, 7:40am UTC](https://discuss.elastic.co/t/watcher-webhook-body/211064 "2019-12-09T07:40:31Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![tsgkdt](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tsgkdt/32/39151_2.png) [@tsgkdt](https://discuss.elastic.co/u/tsgkdt)\
**Post date:** [December 10, 2019, 4:18am UTC](https://discuss.elastic.co/t/watcher-webhook-body/211064/5 "2019-12-10T04:18:18Z")

</div>

KibanaのManagement/Watcherの管理画面より、条件を入力されてますでしょうか？

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/9/e/9ee2ce58b3cb8e46d4e7aa948a0d26cbb531e67f.png)

このエディタでは、 ””” を使って改行を入れた書き方がサポートされていませんので、１行で書く必要があります。

そこで、このように書いてみてください。

```auto
        ～中略～
        "params": {},
        "headers": {},
        "body": "{\"text\": \"あいうえお\"}"

```

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/1/8/1858c8a926aca7b045d3e2076192eab828ebd192.png)

DevToolsからWatcherを作成する場合には、先に示しました”””を使った書き方でもエラーになりません。

現象としては、以下の投稿と同一の現象かと思われます。

> [@Watcherのscriptにおける記述作法](https://discuss.elastic.co/t/watcher-script/207610):
>
> お世話になります。 基礎的な質問で大変恐縮なのですが、 Watcher の advanced watch に設定するconditionで、scriptを記述したいのですが、 下記URLのような書き方（scriptのプログラムを「"""」で囲む）をすると、エラーが発生します。 エラーメッセージ [Watch%20JSON%20error] Watch JSON（抜粋） "condition": { "script": { "source": """ ctx.payload.hits.hits[0] = ctx.payload.hits.hits[0].\_source; int i = ctx.payload.hits.hits[0]['value0']; return i \> 0 """ , "lang": "painless" } }, 補足 scriptのプログラムを 「"""」で囲って複数行 → 「"」で囲って1行にまとめる と変更すると、問題なく動作します…

---

_[View the full topic](https://discuss.elastic.co/t/watcher-webhook-body/211064)._
