# Logstash elasticsearch to csv pipeline issue - returns all the documents irrespective of the "size" parameter in the query

**URL:** <https://discuss.elastic.co/t/logstash-elasticsearch-to-csv-pipeline-issue-returns-all-the-documents-irrespective-of-the-size-parameter-in-the-query/119723>\
**Category:** Logstash\
**Created:** [February 14, 2018, 5:06am UTC](https://discuss.elastic.co/t/logstash-elasticsearch-to-csv-pipeline-issue-returns-all-the-documents-irrespective-of-the-size-parameter-in-the-query/119723 "2018-02-14T05:06:55Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![somkhil](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/somkhil/32/108980_2.png) [@somkhil](https://discuss.elastic.co/u/somkhil)\
**Post date:** [February 14, 2018, 5:06am UTC](https://discuss.elastic.co/t/logstash-elasticsearch-to-csv-pipeline-issue-returns-all-the-documents-irrespective-of-the-size-parameter-in-the-query/119723/1 "2018-02-14T05:06:55Z")

</div>

logstash elasticsearch to csv pipeline returns all the documents irrespective of the "size" parameter in the query.

I have set up elasticsearch to csv pipeline using logstash and it pulls all the docs into output file successfully. However it pulls all the documents in the elasticsearch index/type and ignores the size parameter specified in the query.

# Here is my config file:

input {  
elasticsearch {  
hosts =\> ["hostname"]  
index =\> "indexname"  
query =\> '{  
"from" : 0, "size" : 25,  
"\_source": {  
"includes": ["\*"]

},  
"query": {  
"bool": {  
"must": [  
{"terms":{"fieldname": ["x","y"]}},  
{"terms":{"\_type":["doctype"]}}  
]  
}  
}  
}'  
}}

# output { csv { fields =\> ["a","b","c"] path =\> "/usr/share/logstash/output.csv" } }

I am specifying size=25, however I get thousands of docs in the output file.

Any pointers please?

---

<div class="post-metadata">

**Author:** ![somkhil](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/somkhil/32/108980_2.png) [@somkhil](https://discuss.elastic.co/u/somkhil)\
**Post date:** [February 15, 2018, 11:43am UTC](https://discuss.elastic.co/t/logstash-elasticsearch-to-csv-pipeline-issue-returns-all-the-documents-irrespective-of-the-size-parameter-in-the-query/119723/2 "2018-02-15T11:43:28Z")

</div>

HI Guys - Any inputs on this please.

---

<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:** [March 15, 2018, 11:43am UTC](https://discuss.elastic.co/t/logstash-elasticsearch-to-csv-pipeline-issue-returns-all-the-documents-irrespective-of-the-size-parameter-in-the-query/119723/3 "2018-03-15T11:43:32Z")

</div>

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