# Logstash Elasticsearch ouput: Append array while upserting

**URL:** https://discuss.elastic.co/t/logstash-elasticsearch-ouput-append-array-while-upserting/70010
**Category:** Logstash
**Created:** [December 26, 2016, 2:26pm UTC](https://discuss.elastic.co/t/logstash-elasticsearch-ouput-append-array-while-upserting/70010 "2016-12-26T14:26:00Z")
**Posts on this page:** 1
**Showing post:** 4

<div class="post-metadata">

### Author: ![slinky](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/slinky/32/13323_2.png) [@slinky](https://discuss.elastic.co/u/slinky)
#### Post date: [January 2, 2017, 10:49am UTC](https://discuss.elastic.co/t/logstash-elasticsearch-ouput-append-array-while-upserting/70010/4 "2017-01-02T10:49:01Z")

</div>

@magnusbaeck Thanks for your reply, I tried your suggestion:

```
script => "ctx._source.shodan.protocols += %{[shodan][protocols]}"

```

Results in the following error:  
"reason"=\>"compile error", "caused\_by"=\>{"type"=\>"illegal\_argument\_exception", "reason"=\>"invalid sequence of tokens near ['%'].", "caused\_by"=\>{"type"=\>"no\_viable\_alt\_exception"

Same error with this:

```
 script => "%{[ctx][_source][shodan][protocols]} += %{[shodan][protocols]}"

```

It indicated some syntax error near the % symbol, I'm not sure whats wrong with it.

Also, when I start logstash with file input, I will get the "Too many dynamic script compilations within one minute, max: [15/min]" error when the file got more then 15 new events. I tried this in elasticsearch.yml:

```
script.max_compilations_per_minute: 100000

```

Restarted Elasticsearch but it seems not to read of ignore that line, because I get the same error. Also tried with 10000, 1000 and 100.

Any suggestions?

---

_[View the full topic](https://discuss.elastic.co/t/logstash-elasticsearch-ouput-append-array-while-upserting/70010)._
