# Logstash input elasticsearch plugin throws error

**URL:** <https://discuss.elastic.co/t/logstash-input-elasticsearch-plugin-throws-error/101956>\
**Category:** Logstash\
**Created:** [September 27, 2017, 9:11am UTC](https://discuss.elastic.co/t/logstash-input-elasticsearch-plugin-throws-error/101956 "2017-09-27T09:11:50Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![kabali12345](https://avatars.discourse-cdn.com/v4/letter/k/6a8cbe/32.png) [@kabali12345](https://discuss.elastic.co/u/kabali12345)\
**Post date:** [September 27, 2017, 9:11am UTC](https://discuss.elastic.co/t/logstash-input-elasticsearch-plugin-throws-error/101956/1 "2017-09-27T09:11:50Z")

</div>

Hi all  
here i am trying to get data from elasticsearch and send it stdout  
but the problem is logstash does not stopped after fetching all records in index  
its repeatedly fetching all records .  
my logstash.conf  
i am useing **logstash-5.4.0**

```auto
input {
 elasticsearch {
    hosts => "192.168.1.59:9233"
     index => "aemnetp_data222"
 } 
}

output {
stdout {codec => rubydebug }
}

```

And the error its throwing is

```auto
[2017-09-27T14:33:42,688][ERROR][logstash.pipeline] A plugin had an unrecoverable error. Will restart this plugin.
  Plugin: <LogStash::Inputs::Elasticsearch hosts=>["192.168.1.59:9233"], index=>"aemnetp_data222", id=>"a003783548193a0d60ea553472d53cdad69da91a-1", enable_metric=>true, codec=><LogStash::Codecs::JSON id=>"json_5eae7fce-d112-465d-8de6-07a98e6ec24f", enable_metric=>true, charset=>"UTF-8">, query=>"{ \"sort\": [\"_doc\"] }", size=>1000, scroll=>"1m", docinfo=>false, docinfo_target=>"@metadata", docinfo_fields=>["_index", "_type", "_id"], ssl=>false>
  Error: [400] {"error":{"root_cause":[{"type":"illegal_argument_exception","reason":"Failed to parse request body"}],"type":"illegal_argument_exception","reason":"Failed to parse request body","caused_by":{"type":"json_parse_exception","reason":"Unrecognized token 'DnF1ZXJ5VGhlbkZldGNoBgAAAAAAAdSEFlo2am5iUUE3U3phZF96eE8zYkVwX0EAAAAAAAHUWhZrQUh0NDdSU1EzS2QzWkdIanBfeTVRAAAAAAAB1FkWa0FIdDQ3UlNRM0tkM1pHSGpwX3k1UQAAAAAAAdSFFlo2am5iUUE3U3phZF96eE8zYkVwX0EAAAAAAAHUWxZrQUh0NDdSU1EzS2QzWkdIanBfeTVRAAAAAAAB1IYWWjZqbmJRQTdTemFk...': was expecting ('true', 'false' or 'null')\n at [Source: org.elasticsearch.transport.netty4.ByteBufStreamInput@1e663aa7; line: 1, column: 257]"}},"status":400}

```

Please help me with this where i don't want logstash to repeatedly query data from ES.

Thank You.

---

<div class="post-metadata">

**Author:** ![kabali12345](https://avatars.discourse-cdn.com/v4/letter/k/6a8cbe/32.png) [@kabali12345](https://discuss.elastic.co/u/kabali12345)\
**Post date:** [September 27, 2017, 1:46pm UTC](https://discuss.elastic.co/t/logstash-input-elasticsearch-plugin-throws-error/101956/2 "2017-09-27T13:46:00Z")

</div>

i updated the logstash input elasticsearch plugin which solves my problem  
Thank You.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [October 25, 2017, 1:46pm UTC](https://discuss.elastic.co/t/logstash-input-elasticsearch-plugin-throws-error/101956/3 "2017-10-25T13:46:00Z")

</div>

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