Problem in parsing json string

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

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.

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