# Import (21gb) csv to elasticsearch

**URL:** https://discuss.elastic.co/t/import-21gb-csv-to-elasticsearch/162771
**Category:** Elasticsearch
**Created:** [January 3, 2019, 9:10am UTC](https://discuss.elastic.co/t/import-21gb-csv-to-elasticsearch/162771 "2019-01-03T09:10:06Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![A\_B](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/a_b/32/17104_2.png) [@A\_B](https://discuss.elastic.co/u/A_B)
#### Post date: [January 3, 2019, 9:38am UTC](https://discuss.elastic.co/t/import-21gb-csv-to-elasticsearch/162771/2 "2019-01-03T09:38:54Z")

</div>

Hi @examin,

Logstash has a [csv _filter_](https://www.elastic.co/guide/en/logstash/current/plugins-filters-csv.html).

You could start with a few lines and just output to STDOUT.

The Logstash config would be something like (I have not used this so might not be 100% right)

```
input { stdin { } }

filter {
  csv {
    autodetect_column_names => true
  }
}
output {
  stdout { codec => rubydebug }
}

```

Download Logstash and start with

> logstash-6.3.1/bin/logstash -f above\_config.conf

Paste in one line and see how it is parsed. Once you are happy you can change input to [_file_](https://www.elastic.co/guide/en/logstash/current/plugins-inputs-file.html) and output to [Elasticsearch](https://www.elastic.co/guide/en/logstash/current/plugins-outputs-elasticsearch.html).

I'm sure there are many other ways to do it as well.

---

_[View the full topic](https://discuss.elastic.co/t/import-21gb-csv-to-elasticsearch/162771)._
