Expected closing JSON object after parsing input named in watch – How to solve this Elasticsearch exception

Opster Team

August-23, Version: 6.8-7.15

Briefly, this error occurs when Elasticsearch encounters a malformed JSON object in a watch definition. It’s expecting a closing bracket for a JSON object but doesn’t find one. This usually happens due to a syntax error in the JSON object. To resolve this issue, you can validate your JSON object using a JSON validator to ensure it’s correctly formatted. Also, check for missing or extra commas, brackets, or quotation marks. Lastly, ensure that all strings are properly enclosed in quotation marks.

This guide will help you check for common problems that cause the log ” Expected closing JSON object after parsing input [{}] named [{}] in watch [{}] ” to appear. To understand the issues related to this log, read the explanation below about the following Elasticsearch concepts: plugin.

Log Context

Log “Expected closing JSON object after parsing input [{}] named [{}] in watch [{}]” class name is ChainInput.java. We extracted the following from Elasticsearch source code for those seeking an in-depth context :

 Input input = inputRegistry.parse(watchId; parser).input();  // expecting closing of two json object to start the next element in the array
 if (parser.currentToken() != XContentParser.Token.END_OBJECT || parser.nextToken() != XContentParser.Token.END_OBJECT) {
 throw new ElasticsearchParseException("Expected closing JSON object after parsing input [{}] named [{}] in watch [{}]";
 input.type(); name; watchId);
 }  return input;
 }

 

How helpful was this guide?

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?