_jsonparsefailure on reading json

Dear community,
I need to parse a JSON of the following format:

{
  "commitId": "xxxxxxx",
  "author": {
    "name": "",
    "email": "",
    "date": ""
  },
  "committer": {
    "name": "",
    "email": "",
    "date": ""
  },
  "comment": "",
  "changeCounts": {
    "Add":,
    "Edit":,
    "Delete":0
  },
  "url": "",
  "remoteUrl": ""
}

My pipeline.conf looks like this:

input{
	file{
		path => "somepath"
		start_position => "beginning"
		sincedb_path => "nul"
}
}


filter{
	json {
		source => "message"
		}
}

output{
		stdout {codec =>rubydebug}
		elasticsearch {
			hosts =>"http://localhost:9200"
			index => "demo-json"
}

}

However I am getting a _jsonparsefailure error on almost any line of the json.
My goal is a format like this

{
"commitID": "",
"authorName": "",
"date":"",
"comment": ""
}

What could the reason for _jsoparsefailure be and how can I "level up" the nested fields in the next step?

Thank you in advance.

If your JSON is pretty-printed then see this post.

Also your JSON example isn't valid. Should look something like below.

    "Add": "",
    "Edit": "",

or if expecting numbers

    "Add": null,
    "Edit": null,

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