# Logstash output elasticsearch script error

**URL:** <https://discuss.elastic.co/t/logstash-output-elasticsearch-script-error/177004>\
**Category:** Logstash\
**Created:** [April 16, 2019, 6:17am UTC](https://discuss.elastic.co/t/logstash-output-elasticsearch-script-error/177004 "2019-04-16T06:17:06Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![xingzhi\_Zhang](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/xingzhi_zhang/32/44216_2.png) [@xingzhi\_Zhang](https://discuss.elastic.co/u/xingzhi_Zhang)\
**Post date:** [April 16, 2019, 6:17am UTC](https://discuss.elastic.co/t/logstash-output-elasticsearch-script-error/177004/1 "2019-04-16T06:17:06Z")

</div>

I need to update the local field json in elasticsearch and get an error.

My script file output elasticsearch is:  
script =\>"ctx.\_source.supplier.%{gys}.kcl=params.event.get('message')"

error:  
[2019-04-16T14:11:53,468][WARN][logstash.outputs.elasticsearch] Could not index event to Elasticsearch. {:status=\>400, :action=\>["update", {:\_id=\>"2018080218182069036", :\_index=\>"test\_bls", :\_type=\>"doc", :\_routing=\>nil, :\_retry\_on\_conflict=\>3}, #LogStash::Event:0x5a47a394], :response=\>{"update"=\>{"\_index"=\>"test\_bls", "\_type"=\>"doc", "\_id"=\>"2018080218182069036", "status"=\>400, "error"=\>{"type"=\>"illegal\_argument\_exception", "reason"=\>"failed to execute script", "caused\_by"=\>{"type"=\>"script\_exception", "reason"=\>"runtime error", "script\_stack"=\>["ctx.\_source.supplier.67355576741431019538494530675210.kcl=params.event.get('message')", " ^---- HERE"], "script"=\>"ctx.\_source.supplier.67355576741431019538494530675210.kcl=params.event.get('message')", "lang"=\>"painless", "caused\_by"=\>{"type"=\>"null\_pointer\_exception", "reason"=\>nil}}}}}}

---

<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 14, 2019, 6:17am UTC](https://discuss.elastic.co/t/logstash-output-elasticsearch-script-error/177004/2 "2019-05-14T06:17:08Z")

</div>

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