# CSV from elasticsearch

**URL:** <https://discuss.elastic.co/t/csv-from-elasticsearch/90678>\
**Category:** Elasticsearch\
**Created:** [June 23, 2017, 6:36pm UTC](https://discuss.elastic.co/t/csv-from-elasticsearch/90678 "2017-06-23T18:36:37Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lbr1](https://avatars.discourse-cdn.com/v4/letter/l/7ea924/32.png) [@Lbr1](https://discuss.elastic.co/u/Lbr1)\
**Post date:** [June 23, 2017, 6:36pm UTC](https://discuss.elastic.co/t/csv-from-elasticsearch/90678/1 "2017-06-23T18:36:37Z")

</div>

Good afternoon community,

I want to create a .csv file with certain data fields.

Initially I used logstash with the following code

```
    input {
      elasticsearch {
    		hosts => "localhost:9200"
    		index => "teste21"
    		query => '{"query":{"match_all":{}}}'
    		#size => 2
    	}
    }

    output {
    	csv	{
    	fields => ["_id","text","_type"]
    	path => "....."	
    	}
    }

```

but the result Is not as expected, something of the genre "% {hosts}% {message}}, after a search I read that version 5.x did not allowthat and had to use 2.x, but with this version I can not even generate the file.

Then I installed the dataformat 5.3.0 plugin and after confirming that it was installed, I used the command `curl -o /tmp/data.csv -XGET "localhost: 9200 / index / type / _data? Format = csv & source =`

But it gives an error and the elasticsearch is closed.

Someone can help me, regards.  
Lbr1

---

<div class="post-metadata">

**Author:** ![Itamar\_Syn\_Hershko](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/itamar_syn_hershko/32/725_2.png) [@Itamar\_Syn\_Hershko](https://discuss.elastic.co/u/Itamar_Syn_Hershko)\
**Post date:** [June 25, 2017, 11:57am UTC](https://discuss.elastic.co/t/csv-from-elasticsearch/90678/2 "2017-06-25T11:57:06Z")

</div>

Sounds like a question to the plugin author?

Itamar Syn-Hershko  
Freelance Developer & Consultant  
Microsoft MVP | [Lucene.NET](http://Lucene.NET) PMC  
[http://code972.com](http://code972.com) | @synhershko  
[http://BigDataBoutique.co.il/](http://BigDataBoutique.co.il/)

---

<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 23, 2017, 11:57am UTC](https://discuss.elastic.co/t/csv-from-elasticsearch/90678/3 "2017-07-23T11:57:08Z")

</div>

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