# Parsing JSON Array results in JSON parse error

**URL:** https://discuss.elastic.co/t/parsing-json-array-results-in-json-parse-error/107904
**Category:** Logstash
**Created:** [November 16, 2017, 10:36am UTC](https://discuss.elastic.co/t/parsing-json-array-results-in-json-parse-error/107904 "2017-11-16T10:36:29Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Robert\_Andersson](https://avatars.discourse-cdn.com/v4/letter/r/e8c25b/32.png) [@Robert\_Andersson](https://discuss.elastic.co/u/Robert_Andersson)
#### Post date: [November 16, 2017, 10:36am UTC](https://discuss.elastic.co/t/parsing-json-array-results-in-json-parse-error/107904/1 "2017-11-16T10:36:30Z")

</div>

I am trying to parse a JSON array by using the `json codec`. I have been looking at [split](https://www.elastic.co/guide/en/logstash/current/plugins-filters-split.html). But all the examples assume that the array is within a JSON object. But in my situation, the array is not within an object.

The data comes in the following structure but on a **single line** :

```
[
    {
        "prop1": "value1",
        "prop2": "value2",
        "prop3": "value3"
    },
    {
        "prop1": "value1",
        "prop2": "value2",
        "prop3": "value3"
    }
]
```

---

<div class="post-metadata">

### Author: ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)
#### Post date: [November 16, 2017, 12:05pm UTC](https://discuss.elastic.co/t/parsing-json-array-results-in-json-parse-error/107904/2 "2017-11-16T12:05:35Z")

</div>

Please show the error message.

---

<div class="post-metadata">

### Author: ![Robert\_Andersson](https://avatars.discourse-cdn.com/v4/letter/r/e8c25b/32.png) [@Robert\_Andersson](https://discuss.elastic.co/u/Robert_Andersson)
#### Post date: [November 16, 2017, 1:07pm UTC](https://discuss.elastic.co/t/parsing-json-array-results-in-json-parse-error/107904/3 "2017-11-16T13:07:56Z")

</div>

`[2017-11-16T13:03:48,957][ERROR][logstash.codecs.json] JSON parse error, original data now in message field {:error=>#<LogStash::Json::ParserError: Unexpected end-of-input: expected close marker for Array.`

---

<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: [December 14, 2017, 1:07pm UTC](https://discuss.elastic.co/t/parsing-json-array-results-in-json-parse-error/107904/4 "2017-12-14T13:07:56Z")

</div>

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