# Logstash JSON parse error

**URL:** <https://discuss.elastic.co/t/logstash-json-parse-error/272533>\
**Category:** Logstash\
**Created:** [May 10, 2021, 5:14am UTC](https://discuss.elastic.co/t/logstash-json-parse-error/272533 "2021-05-10T05:14:27Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [May 11, 2021, 4:59pm UTC](https://discuss.elastic.co/t/logstash-json-parse-error/272533/4 "2021-05-11T16:59:49Z")

</div>

Do not use a codec. Use a json filter. Something like

```
json { source => "message" target => "someField" }

```

The move the fields up to the root using something like [this](https://discuss.elastic.co/t/how-to-dynamically-move-nested-key-value-to-root-level/180006/2).

---

_[View the full topic](https://discuss.elastic.co/t/logstash-json-parse-error/272533)._
