# Input Json file

**URL:** <https://discuss.elastic.co/t/input-json-file/107781>\
**Category:** Logstash\
**Created:** [November 15, 2017, 3:58pm UTC](https://discuss.elastic.co/t/input-json-file/107781 "2017-11-15T15:58:03Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![guyboertje](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/guyboertje/32/31592_2.png) [@guyboertje](https://discuss.elastic.co/u/guyboertje)\
**Post date:** [November 15, 2017, 5:01pm UTC](https://discuss.elastic.co/t/input-json-file/107781/5 "2017-11-15T17:01:27Z")

</div>

Generally, you will have a tough time with multiline or pretty-printed JSON in LS, this is because it is hard to know when the last `}` is reached especially if there is no newline after the `}` character.

When you use the `pattern => "^}$"` (a brace at the start of a line ) with `what => "previous"` the text satisfying the pattern is not seen as belonging to the previous and the accumulation of JSON lines has no final `}`.

Having said that a `pattern => "^{$"` with what next relies on a timeout flush feature to flush the accumulation buffer because another `\n{` is never seen. Filebeat's implementation of this timeout is better than the LS one.

---

_[View the full topic](https://discuss.elastic.co/t/input-json-file/107781)._
