# Concatenate using painless in Output

**URL:** <https://discuss.elastic.co/t/concatenate-using-painless-in-output/140317>\
**Category:** Logstash\
**Created:** [July 17, 2018, 11:26am UTC](https://discuss.elastic.co/t/concatenate-using-painless-in-output/140317 "2018-07-17T11:26:47Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![saramali](https://avatars.discourse-cdn.com/v4/letter/s/da6949/32.png) [@saramali](https://discuss.elastic.co/u/saramali)\
**Post date:** [July 17, 2018, 11:26am UTC](https://discuss.elastic.co/t/concatenate-using-painless-in-output/140317/1 "2018-07-17T11:26:47Z")

</div>

I am trying to update the message body of an indexed log. To be specific I am trying to concatenate. I am getting no error on the logstash console yet the message body is not being updated.

Here is the update part from the output

```
  " action => "update"
    script_lang => "painless"
    script_type => "inline"
    script => 'ctx._source.stock_message.concat("%{stock_message}")'"
```

---

<div class="post-metadata">

**Author:** ![saramali](https://avatars.discourse-cdn.com/v4/letter/s/da6949/32.png) [@saramali](https://discuss.elastic.co/u/saramali)\
**Post date:** [July 17, 2018, 12:19pm UTC](https://discuss.elastic.co/t/concatenate-using-painless-in-output/140317/2 "2018-07-17T12:19:07Z")

</div>

I found the problem.

" script =\> 'ctx.\_source.stock\_message = ctx.\_source.stock\_message.concat("%{stock\_message}" + "\n")'"

This is the correct. But now I am getting circut breaker exception due to compiling more than 15 times in a minute. How can I use script.max\_compilations\_rate in the logstash script.

---

<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:** [August 14, 2018, 12:19pm UTC](https://discuss.elastic.co/t/concatenate-using-painless-in-output/140317/3 "2018-08-14T12:19:13Z")

</div>

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