# Problem in parsing json string

**URL:** https://discuss.elastic.co/t/problem-in-parsing-json-string/238901
**Category:** Logstash
**Created:** [June 26, 2020, 6:18pm UTC](https://discuss.elastic.co/t/problem-in-parsing-json-string/238901 "2020-06-26T18:18:29Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![azteker](https://avatars.discourse-cdn.com/v4/letter/a/aca169/32.png) [@azteker](https://discuss.elastic.co/u/azteker)
#### Post date: [June 26, 2020, 6:18pm UTC](https://discuss.elastic.co/t/problem-in-parsing-json-string/238901/1 "2020-06-26T18:18:29Z")

</div>

This is how I parse json in filter  
json {  
source =\> "json\_content"  
target =\> "content"  
remove\_field=\>["json\_content"]  
}  
But I got the following error

> "type"=\>"mapper\_parsing\_exception", "reason"=\>"failed to parse field [content] of type [text] in document with id '6vnV8XIBuDHdfTNTFMF-'", "caused\_by"=\>{"type"=\>"illegal\_state\_exception", "reason"=\>"Can't get text on a START\_OBJECT at 1:81"}

What should I do? Please help

---

<div class="post-metadata">

### Author: ![Jenni](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jenni/32/29684_2.png) [@Jenni](https://discuss.elastic.co/u/Jenni)
#### Post date: [June 26, 2020, 6:45pm UTC](https://discuss.elastic.co/t/problem-in-parsing-json-string/238901/2 "2020-06-26T18:45:44Z")

</div>

That is not an error that occurred while parsing the JSON string. The problem is that you have mapped your field in Elasticsearch as `text` (probably not intentionally, but by indexing a document that had a string there and letting the automatic mapping detect the type), but are now trying to save the parsed json, which is an `object`. You'll need to reindex your data in a new index with the correct mapping.

---

<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 24, 2020, 6:45pm UTC](https://discuss.elastic.co/t/problem-in-parsing-json-string/238901/3 "2020-07-24T18:45:45Z")

</div>

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