Logstash raising json_e_o_f_exception when input events are coming from elastisearch

Here is my configuration file

input {
elasticsearch {
hosts => ["XXXXXXXXXXXXXX.ap-southeast-1.es.amazonaws.com:443"]
index => "transcripts"
query => '{ "query": { "match_all": {} }'
scroll => "5m"
size => 100
ssl => true
}
}

filter {

}

output{

stdout { codec => rubydebug}
}

I use logstash v6.2.2 to remotely read elasticsearch v6.0.1 in aws.

Logs showed json_e_o_f_exception and 500 Internal Server Error

The following are the error logs.

[ERROR] 2018-04-11 20:53:42.610 [[main]<elasticsearch] pipeline - A plugin had an unrecoverable error. Will restart this plugin.
Pipeline_id:main
Plugin: <LogStash::Inputs::Elasticsearch hosts=>["XXXXXXXXXXXXXX.ap-southeast-1.es.amazonaws.com:443"], query=>"{ "query": { "match_all": {} }", scroll=>"5m", ssl=>true, size=>100, docinfo=>true, index=>"transcripts", id=>"cc6608de73166f4d5d5874033fff0850fac5f2049b235c959825eb45154f8b81", enable_metric=>true, codec=><LogStash::Codecs::JSON id=>"json_16f75b5b-fdb8-4417-ac40-ccaab3f95010", enable_metric=>true, charset=>"UTF-8">, docinfo_target=>"@metadata", docinfo_fields=>["_index", "_type", "_id"]>
Error: [500] {"error":{"root_cause":[{"type":"json_e_o_f_exception","reason":"Unexpected end-of-input: expected close marker for Object (start marker at [Source: org.elasticsearch.common.bytes.BytesReference$MarkSupportingStreamInputWrapper@254304b2; line: 1, column: 1])\n at [Source: org.elasticsearch.common.bytes.BytesReference$MarkSupportingStreamInputWrapper@254304b2; line: 1, column: 61]"}],"type":"json_e_o_f_exception","reason":"Unexpected end-of-input: expected close marker for Object (start marker at [Source: org.elasticsearch.common.bytes.BytesReference$MarkSupportingStreamInputWrapper@254304b2; line: 1, column: 1])\n at [Source: org.elasticsearch.common.bytes.BytesReference$MarkSupportingStreamInputWrapper@254304b2; line: 1, column: 61]"},"status":500}
Exception: Elasticsearch::Transport::Transport::Errors::InternalServerError
Stack: /usr/share/logstash/vendor/bundle/jruby/2.3.0/gems/elasticsearch-transport-5.0.4/lib/elasticsearch/transport/transport/base.rb:202:in __raise_transport_error' /usr/share/logstash/vendor/bundle/jruby/2.3.0/gems/elasticsearch-transport-5.0.4/lib/elasticsearch/transport/transport/base.rb:319:inperform_request'
/usr/share/logstash/vendor/bundle/jruby/2.3.0/gems/elasticsearch-transport-5.0.4/lib/elasticsearch/transport/transport/http/faraday.rb:20:in perform_request' /usr/share/logstash/vendor/bundle/jruby/2.3.0/gems/elasticsearch-transport-5.0.4/lib/elasticsearch/transport/client.rb:131:inperform_request'
/usr/share/logstash/vendor/bundle/jruby/2.3.0/gems/elasticsearch-api-5.0.4/lib/elasticsearch/api/actions/search.rb:183:in search' /usr/share/logstash/vendor/bundle/jruby/2.3.0/gems/logstash-input-elasticsearch-4.2.0/lib/logstash/inputs/elasticsearch.rb:200:indo_run'
/usr/share/logstash/vendor/bundle/jruby/2.3.0/gems/logstash-input-elasticsearch-4.2.0/lib/logstash/inputs/elasticsearch.rb:188:in run' /usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:516:ininputworker'
/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:509:in `block in start_input'

Any help is much appreciated.

There's a } missing from your query.

Thank you very much

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