# Transform句で複数スクリプトを登録する方法

**URL:** <https://discuss.elastic.co/t/transform/193919>\
**Category:** 日本語による質問・議論はこちら\
**Created:** [August 6, 2019, 5:03am UTC](https://discuss.elastic.co/t/transform/193919 "2019-08-06T05:03:16Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![t-nakata](https://avatars.discourse-cdn.com/v4/letter/t/8491ac/32.png) [@t-nakata](https://discuss.elastic.co/u/t-nakata)\
**Post date:** [August 6, 2019, 5:03am UTC](https://discuss.elastic.co/t/transform/193919/1 "2019-08-06T05:03:17Z")

</div>

WatcherのAlertingの設定で、transform句でスクリプトを複数登録すると、エラーになってしまいます。スクリプトを複数複数登録する方法を教えて下さい。  
シミュレーション時に以下のエラーが発生します  
[parse\_exception] could not parse watch [_inlined_]. null token

Wathcerの設定が以下のようにしています  
{  
"trigger": {  
"schedule": {  
"interval": "2m"  
}  
},  
"input": {  
"search": {  
"request": {  
"search\_type": "query\_then\_fetch",  
"indices": [  
"syslog-err-\*"  
],  
"rest\_total\_hits\_as\_int": true,  
"body": {  
"query": {  
"match": {  
"word3": "aaa"  
}  
}  
}  
}  
}  
},  
"condition": {  
"compare": {  
"ctx.payload.hits.total": {  
"gte": 1  
}  
}  
},  
"actions": {  
"send\_email": {  
"email": {  
"profile": "standard",  
"to": [  
"XXXXXXXXXXXXXXXXXX"  
],  
"subject": "Watcher Notification",  
"body": {  
"text": "test {{ctx.payload.\_value}}"  
}  
}  
}  
},  
"transform": [  
{"script": "int a = 2;return a"},  
{"script": "int b = 3;return b"}  
]  
}

---

<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:** [September 3, 2019, 5:06am UTC](https://discuss.elastic.co/t/transform/193919/2 "2019-09-03T05:06:49Z")

</div>

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