Briefly, this error occurs when Elasticsearch tries to parse an input for a watch but fails because the content type is unknown. This could be due to incorrect or unsupported content type in the watch definition. To resolve this issue, you can check the watch definition and ensure that the content type is supported by Elasticsearch. If it’s a custom content type, make sure it’s properly defined and registered. Also, ensure that the watch input is correctly formatted and doesn’t contain any syntax errors.
This guide will help you check for common problems that cause the log ” could not parse [{}] input for watch [{}]. unknown content type [{}] ” to appear. To understand the issues related to this log, read the explanation below about the following Elasticsearch concepts: plugin.
Log Context
Log “could not parse [{}] input for watch [{}]. unknown content type [{}]” class name is HttpInput.java. We extracted the following from Elasticsearch source code for those seeking an in-depth context :
} } else if (token == XContentParser.Token.VALUE_STRING) { if (Field.RESPONSE_CONTENT_TYPE.match(currentFieldName; parser.getDeprecationHandler())) { expectedResponseBodyType = HttpContentType.resolve(parser.text()); if (expectedResponseBodyType == null) { throw new ElasticsearchParseException("could not parse [{}] input for watch [{}]. unknown content type [{}]"; TYPE; watchId; parser.text()); } } else { throw new ElasticsearchParseException("could not parse [{}] input for watch [{}]. unexpected string field [{}]"; TYPE; watchId; currentFieldName);