# Logstash 5.4 elasticsearch input size not working

**URL:** https://discuss.elastic.co/t/logstash-5-4-elasticsearch-input-size-not-working/111422
**Category:** Logstash
**Created:** [December 12, 2017, 7:43pm UTC](https://discuss.elastic.co/t/logstash-5-4-elasticsearch-input-size-not-working/111422 "2017-12-12T19:43:20Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![frankfoti](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/frankfoti/32/26965_2.png) [@frankfoti](https://discuss.elastic.co/u/frankfoti)
#### Post date: [December 12, 2017, 7:43pm UTC](https://discuss.elastic.co/t/logstash-5-4-elasticsearch-input-size-not-working/111422/1 "2017-12-12T19:43:20Z")

</div>

The below always returns all docs. We want to limit the return set to 2:

input {

# Read all documents from Elasticsearch matching the given query

elasticsearch {  
hosts =\> "[xxx.xxx.xxx.xxx:9202](http://xxx.xxx.xxx.xxx:9202)"  
index =\> "rrdb\_matter\_1"  
query =\> '{"\_source":["matter\_id"],"size":2,"query": {"match\_all": {} }}'  
}  
}

---

<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: [January 9, 2018, 7:43pm UTC](https://discuss.elastic.co/t/logstash-5-4-elasticsearch-input-size-not-working/111422/2 "2018-01-09T19:43:31Z")

</div>

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