# \[Painless\] Stored script - Multiline - Parsing Error

**URL:** <https://discuss.elastic.co/t/painless-stored-script-multiline-parsing-error/211091>\
**Category:** Elasticsearch\
**Tags:** painless\
**Created:** [December 9, 2019, 10:22am UTC](https://discuss.elastic.co/t/painless-stored-script-multiline-parsing-error/211091 "2019-12-09T10:22:24Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Remy\_Letient](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/remy_letient/32/48128_2.png) [@Remy\_Letient](https://discuss.elastic.co/u/Remy_Letient)\
**Post date:** [December 9, 2019, 10:22am UTC](https://discuss.elastic.co/t/painless-stored-script-multiline-parsing-error/211091/1 "2019-12-09T10:22:24Z")

</div>

Hello,  
I'm new with the usage of script. I understand they are 2 modes to write the script itseft, in a single line and in multiline with the usage of """. But I found sample on Web, but in all cases I have a parsing exception.

> {  
> "script": {  
> "source": """  
> doc['price'].value \* params.factor;  
> """,  
> "lang":"painless"  
> }  
> }

Error :

> "caused\_by": {  
> "type": "json\_parse\_exception",  
> "reason": "Unexpected character ('"' (code 34)): was expecting comma to separate Object entries\n at [Source: org.elasticsearch.transport.netty4.ByteBufStreamInput@42bd8f7; line: 3, column: 18]"  
> }

What I've missed? (I wish to create a stored script in multiline format)  
ES Version: 7.4.1  
REST Client: Postman

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [December 9, 2019, 1:43pm UTC](https://discuss.elastic.co/t/painless-stored-script-multiline-parsing-error/211091/2 "2019-12-09T13:43:49Z")

</div>

This triple ticks notation only works within the [Kibana Dev-Tools Console](https://www.elastic.co/guide/en/kibana/7.5/console-kibana.html), where those triple ticks are replaced and regular JSON is formed from that script, before it is sent to Elasticsearch.

---

<div class="post-metadata">

**Author:** ![Remy\_Letient](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/remy_letient/32/48128_2.png) [@Remy\_Letient](https://discuss.elastic.co/u/Remy_Letient)\
**Post date:** [December 9, 2019, 2:21pm UTC](https://discuss.elastic.co/t/painless-stored-script-multiline-parsing-error/211091/3 "2019-12-09T14:21:18Z")

</div>

Ok thank you.

---

<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:** [January 6, 2020, 2:21pm UTC](https://discuss.elastic.co/t/painless-stored-script-multiline-parsing-error/211091/4 "2020-01-06T14:21:26Z")

</div>

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