# Logstash-plugin elasticsearch: apply excuting searches in logstash

**URL:** <https://discuss.elastic.co/t/logstash-plugin-elasticsearch-apply-excuting-searches-in-logstash/52719>\
**Category:** Logstash\
**Created:** [June 14, 2016, 10:27am UTC](https://discuss.elastic.co/t/logstash-plugin-elasticsearch-apply-excuting-searches-in-logstash/52719 "2016-06-14T10:27:13Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sen](https://avatars.discourse-cdn.com/v4/letter/s/cc9497/32.png) [@sen](https://discuss.elastic.co/u/sen)\
**Post date:** [June 14, 2016, 10:27am UTC](https://discuss.elastic.co/t/logstash-plugin-elasticsearch-apply-excuting-searches-in-logstash/52719/1 "2016-06-14T10:27:13Z")

</div>

Hello everyon,

Here is my excuting search to query my elasticsearch database (it works fine):  
curl -XPOST 'localhost:9200/test/\_search?pretty' -d '  
{  
"size":1,  
"query": {  
"match": {  
"log.device":"xxxx"  
}  
},  
"sort" : [ {  
"\_timestamp" :  
{  
"order":"desc"  
}  
}]  
}'

I want to do the same thing through logstash with the plugin elasticsearch. However, there is no "size" option available in the website [https://www.elastic.co/guide/en/logstash/current/plugins-filters-elasticsearch.html](https://www.elastic.co/guide/en/logstash/current/plugins-filters-elasticsearch.html)

elasticsearch {  
hosts =\> ["localhost:9200/test"]  
query =\> "log.device:%{[log][device]}"  
sort =\> "@timestamp:desc"  
}

Do you how to manage this problem ?

Thank you for your attention and for your help.

S

---

<div class="post-metadata">

**Author:** ![sen](https://avatars.discourse-cdn.com/v4/letter/s/cc9497/32.png) [@sen](https://discuss.elastic.co/u/sen)\
**Post date:** [June 14, 2016, 3:19pm UTC](https://discuss.elastic.co/t/logstash-plugin-elasticsearch-apply-excuting-searches-in-logstash/52719/2 "2016-06-14T15:19:36Z")

</div>

Apparently, it is hard coded with size=1!

---

<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:** [July 6, 2017, 4:53am UTC](https://discuss.elastic.co/t/logstash-plugin-elasticsearch-apply-excuting-searches-in-logstash/52719/3 "2017-07-06T04:53:03Z")

</div>


