# Import a csv into ElasticSearch using logstash - Windows

**URL:** <https://discuss.elastic.co/t/import-a-csv-into-elasticsearch-using-logstash-windows/43401>\
**Category:** Logstash\
**Created:** [March 3, 2016, 2:41pm UTC](https://discuss.elastic.co/t/import-a-csv-into-elasticsearch-using-logstash-windows/43401 "2016-03-03T14:41:02Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![evripides](https://avatars.discourse-cdn.com/v4/letter/e/2bfe46/32.png) [@evripides](https://discuss.elastic.co/u/evripides)\
**Post date:** [March 3, 2016, 2:41pm UTC](https://discuss.elastic.co/t/import-a-csv-into-elasticsearch-using-logstash-windows/43401/1 "2016-03-03T14:41:02Z")

</div>

I am trying to import a csv into ElasticSearch using logstash - Windows but receive the following error

Error: No config files found

Command I run is

logstash -f agent logstash-simple.conf

The config is as follows:

input {  
stdin {  
type =\> "stdin-type"  
}  
file {  
path =\> ["C:/Program Files/ElasticSearch/sample.csv"]  
start\_position =\> "beginning"  
}  
}

filter {  
csv {  
columns =\> ["Name","Year"]  
separator =\> ","  
}  
}

output {

elasticsearch { action =\> "index",  
host =\> "localhost",  
index =\> "customer",  
workers =\> 1 }

}

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [March 3, 2016, 7:38pm UTC](https://discuss.elastic.co/t/import-a-csv-into-elasticsearch-using-logstash-windows/43401/2 "2016-03-03T19:38:11Z")

</div>

> ```
> logstash -f agent logstash-simple.conf
> 
> ```

You're asking Logstash to load a config file named "agent". Do this instead:

```
logstash -f logstash-simple.conf

```

---

<div class="post-metadata">

**Author:** ![evripides](https://avatars.discourse-cdn.com/v4/letter/e/2bfe46/32.png) [@evripides](https://discuss.elastic.co/u/evripides)\
**Post date:** [March 3, 2016, 8:48pm UTC](https://discuss.elastic.co/t/import-a-csv-into-elasticsearch-using-logstash-windows/43401/3 "2016-03-03T20:48:00Z")

</div>

Tried this and still receive the same error message.

Can you make sure this path is a logstash config file?  
You may be interested in the '--configtest; flag which you can use to validate logstash's configuration before you choose to restart a running system.

---

<div class="post-metadata">

**Author:** ![Indian32994441](https://avatars.discourse-cdn.com/v4/letter/i/c2a13f/32.png) [@Indian32994441](https://discuss.elastic.co/u/Indian32994441)\
**Post date:** [May 23, 2016, 8:43am UTC](https://discuss.elastic.co/t/import-a-csv-into-elasticsearch-using-logstash-windows/43401/4 "2016-05-23T08:43:53Z")

</div>

Below code is working for me. Remove commas in output.  
input {  
stdin {  
type =\> "stdin-type"  
}  
file {  
path =\> ["C:/Program Files/ElasticSearch/sample.csv"]  
start\_position =\> "beginning"  
}  
}

filter {  
csv {  
columns =\> ["Name","Year"]  
separator =\> ","  
}  
}

output {

elasticsearch\_http {  
host =\> "localhost:9200"  
index =\> "customer"  
}

}

---

<div class="post-metadata">

**Author:** ![Mario\_van\_Gemert](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mario_van_gemert/32/13832_2.png) [@Mario\_van\_Gemert](https://discuss.elastic.co/u/Mario_van_Gemert)\
**Post date:** [October 12, 2016, 5:59am UTC](https://discuss.elastic.co/t/import-a-csv-into-elasticsearch-using-logstash-windows/43401/5 "2016-10-12T05:59:24Z")

</div>

I had the same problem. Try changing host to hosts in your output.

---

<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:34am UTC](https://discuss.elastic.co/t/import-a-csv-into-elasticsearch-using-logstash-windows/43401/6 "2017-07-06T04:34:39Z")

</div>


