# Logstash JSON codec

**URL:** https://discuss.elastic.co/t/logstash-json-codec/56553
**Category:** Logstash
**Created:** [July 27, 2016, 5:34pm UTC](https://discuss.elastic.co/t/logstash-json-codec/56553 "2016-07-27T17:34:31Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![piyush](https://avatars.discourse-cdn.com/v4/letter/p/ecb155/32.png) [@piyush](https://discuss.elastic.co/u/piyush)
#### Post date: [July 27, 2016, 5:34pm UTC](https://discuss.elastic.co/t/logstash-json-codec/56553/1 "2016-07-27T17:34:31Z")

</div>

Dear Team,  
I am working on processing a JSON file and need some clarification. I read earlier threads and tried using codecs (json, json\_lines and json as filter too) but as output i am getting individual lines of the file and below error:

JSON parse failure. Falling back to plain-text {:error=\>#\<LogStash::Json::ParserError: Unexpected end-of-input: expected close marker for OBJECT (from [Source: [B@1edd238a; line: 1, column: 24])  
at [Source: [B@1edd238a; line: 1, column: 51]\>, :data=\>" {", :level=\>:error}

Please let me know what else is require here, the JSON file is a valid one.

logstash conf:  
file{  
path =\> "inputfile"  
type =\> "input"  
codec =\> "json"  
}

output:  
}  
]  
}  
]  
}

Thanks & Regards,

---

<div class="post-metadata">

### Author: ![piyush](https://avatars.discourse-cdn.com/v4/letter/p/ecb155/32.png) [@piyush](https://discuss.elastic.co/u/piyush)
#### Post date: [July 27, 2016, 6:28pm UTC](https://discuss.elastic.co/t/logstash-json-codec/56553/2 "2016-07-27T18:28:37Z")

</div>

I tried uploading JSON file into elasticsearch and there also i got parsing error, PFB:

It looks like JSON file needs some attention, i am working on it. In the mean time please let me know if we can handle such scenarios in logstash.

```
  "caused_by": {
     "type": "parse_exception",
     "reason": "malformed, expected settings to start with 'object', instead was [VALUE_STRING]"
  }
```

---

<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: [July 30, 2016, 9:22am UTC](https://discuss.elastic.co/t/logstash-json-codec/56553/3 "2016-07-30T09:22:24Z")

</div>

Well, what does the input look like?

---

<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: [July 6, 2017, 4:45am UTC](https://discuss.elastic.co/t/logstash-json-codec/56553/4 "2017-07-06T04:45:48Z")

</div>


