# Elasticsearch search query size limit

**URL:** https://discuss.elastic.co/t/elasticsearch-search-query-size-limit/245278
**Category:** Elasticsearch
**Created:** [August 17, 2020, 4:25pm UTC](https://discuss.elastic.co/t/elasticsearch-search-query-size-limit/245278 "2020-08-17T16:25:02Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![sahere37](https://avatars.discourse-cdn.com/v4/letter/s/b2d939/32.png) [@sahere37](https://discuss.elastic.co/u/sahere37)
#### Post date: [August 17, 2020, 4:25pm UTC](https://discuss.elastic.co/t/elasticsearch-search-query-size-limit/245278/1 "2020-08-17T16:25:02Z")

</div>

Hi all,  
I am using elasticsearch input in my logstash config file. logstash input part is as following:

```
 input {
elasticsearch {
hosts => ["http://10.0.0.1:9200/"]
index => "my-log*"
  query => '{
"from" : 0,
"size" : 1,
		"query": { 
		      "bool" : {
		          "must" : {
		                "match": { "status1": 0 }
		           },
				   "filter" : { 
            "range" : { "mytimestamp" : { "gte": "now-1d/d", "lte": "now-1d/d"}} 
				   }
		      }
		}
		}'
}

```

It is expected that the query returns just one event because of size value, but all events will return. how can i handle the number of events which will be returned in query? I just want to elasticsearch return me the one event. Any advise will be so appreciated  
Regards

---

<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: [September 14, 2020, 4:25pm UTC](https://discuss.elastic.co/t/elasticsearch-search-query-size-limit/245278/2 "2020-09-14T16:25:23Z")

</div>

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