# Logstash-elasticsearch input plugin, size not working as expeted

**URL:** https://discuss.elastic.co/t/logstash-elasticsearch-input-plugin-size-not-working-as-expeted/163344
**Category:** Logstash
**Created:** [January 8, 2019, 10:41am UTC](https://discuss.elastic.co/t/logstash-elasticsearch-input-plugin-size-not-working-as-expeted/163344 "2019-01-08T10:41:09Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![gauravsinghal3](https://avatars.discourse-cdn.com/v4/letter/g/ec9cab/32.png) [@gauravsinghal3](https://discuss.elastic.co/u/gauravsinghal3)
#### Post date: [January 8, 2019, 10:41am UTC](https://discuss.elastic.co/t/logstash-elasticsearch-input-plugin-size-not-working-as-expeted/163344/1 "2019-01-08T10:41:09Z")

</div>

Problem: Every 20 minutes logstash fetches all the records matching as per query in batches of 100(size=100) and waits for next schedule.

in input plugin i have something like this:

elasticsearch{  
size =\> 100  
schedule =\> "\*\20 \* \* \* \*"  
}

NEED: I wanted to retrieve only 100 records from matching set of records against the query every 20 minutes from elasticsearch using logstash.

I will really appreciate the some help here.

---

<div class="post-metadata">

### Author: ![gauravsinghal3](https://avatars.discourse-cdn.com/v4/letter/g/ec9cab/32.png) [@gauravsinghal3](https://discuss.elastic.co/u/gauravsinghal3)
#### Post date: [January 14, 2019, 6:46pm UTC](https://discuss.elastic.co/t/logstash-elasticsearch-input-plugin-size-not-working-as-expeted/163344/2 "2019-01-14T18:46:09Z")

</div>

I have changed my logstash configuration and removed size parameter.  
Now it is like this:

input {  
elasticsearch{  
query =\> '{  
"size": 5,  
"sort": [  
{  
"esUpdateDate": {  
"order": "desc"  
}  
}  
],  
"\_source": [  
"esUpdateDate",  
"beUpdateDate"  
]  
}  
schedule =\> "\*\20 \* \* \* \*"  
}  
}

This also not restricting the size of documents returned by the query.

Really appreciate some help here.

---

<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: [February 11, 2019, 6:46pm UTC](https://discuss.elastic.co/t/logstash-elasticsearch-input-plugin-size-not-working-as-expeted/163344/3 "2019-02-11T18:46:10Z")

</div>

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