# Logstash shows parsing error for json files

**URL:** https://discuss.elastic.co/t/logstash-shows-parsing-error-for-json-files/270890
**Category:** Logstash
**Created:** [April 21, 2021, 5:54pm UTC](https://discuss.elastic.co/t/logstash-shows-parsing-error-for-json-files/270890 "2021-04-21T17:54:08Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![pratyush\_elastic](https://avatars.discourse-cdn.com/v4/letter/p/8baadc/32.png) [@pratyush\_elastic](https://discuss.elastic.co/u/pratyush_elastic)
#### Post date: [April 21, 2021, 5:54pm UTC](https://discuss.elastic.co/t/logstash-shows-parsing-error-for-json-files/270890/1 "2021-04-21T17:54:08Z")

</div>

Hi,  
I am getting json parsing error with logstash intermittently while it tries to read and load to Elastic. Below are the details. Any lead would really be helpful. I tried isolating the file and it works fine

Error:  
:ParserError: Unexpected character ('-' (code 45)): Expected space separating root-level values  
at [Source: (String)"21-04-21T17:09:26.543493", "cluster\_name": "GF-US-Dev-Mfg-MA-EMR-V7.0", "account": "963633305700", "env": "Dev", "cluster\_id": "j-2O3L2OZ72RSSB", "cluster\_status": "RUNNING", "cluster\_starttime": "20201210234344", "cluster\_endtime": "", "fab": "GLOBAL", "capability": "shared-analytics", "functionality": "INLINE", "job\_id": "s-3A7H8B0R035F", "job\_name": "Inline Data Load FAB1 Backlog", "job\_status": "CANCELLED", "job\_creationtime": "20210421140142", "job\_starttime": "", "job\_endtime": "", "job\_ru"[truncated 166 chars]; line: 1, column: 4]\>, :data=\>"21-04-21T17:09:26.543493", "cluster\_name": "GF-US-Dev-Mfg-MA-EMR-V7.0", "account": "963633305700", "env": "Dev", "cluster\_id": "j-2O3L2OZ72RSSB", "cluster\_status": "RUNNING", "cluster\_starttime": "20201210234344", "cluster\_endtime": "", "fab": "GLOBAL", "capability": "shared-analytics", "functionality": "INLINE", "job\_id": "s-3A7H8B0R035F", "job\_name": "Inline Data Load FAB1 Backlog", "job\_status": "CANCELLED", "job\_creationtime": "20210421140142", "job\_starttime": "", "job\_endtime": "", "job\_run\_duration": 0, "executor-memory": "8G", "driver-memory": "8G", "num-executors": "12", "total\_memory": 123.19999999999999, "ram\_minutes": 0.0, "memory\_source": "job"}"}

logstash.conf:  
input {  
file {  
type =\> "emr"  
codec =\> "json"  
path =\> "/data/clo/emcs\*.json"  
start\_position =\> "beginning"  
sincedb\_path=\>"/data/psri/sincedb\_psrivas2.txt"  
}  
}

filter{}

output {  
elasticsearch { hosts =\> [""]  
ssl =\> true  
user =\> "myUser"  
password =\> "Password"  
index =\> "ptest-%{+yyyy.MM.dd}"  
ilm\_enabled =\> false  
}  
}

---

<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: [May 19, 2021, 5:54pm UTC](https://discuss.elastic.co/t/logstash-shows-parsing-error-for-json-files/270890/2 "2021-05-19T17:54:27Z")

</div>

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