# Import CSV File as input in logstash and pass the output data to elasticsearch

**URL:** <https://discuss.elastic.co/t/import-csv-file-as-input-in-logstash-and-pass-the-output-data-to-elasticsearch/74893>\
**Category:** Elasticsearch\
**Created:** [February 13, 2017, 2:18pm UTC](https://discuss.elastic.co/t/import-csv-file-as-input-in-logstash-and-pass-the-output-data-to-elasticsearch/74893 "2017-02-13T14:18:39Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Uma\_Ananthu](https://avatars.discourse-cdn.com/v4/letter/u/bbce88/32.png) [@Uma\_Ananthu](https://discuss.elastic.co/u/Uma_Ananthu)\
**Post date:** [February 13, 2017, 2:18pm UTC](https://discuss.elastic.co/t/import-csv-file-as-input-in-logstash-and-pass-the-output-data-to-elasticsearch/74893/1 "2017-02-13T14:18:39Z")

</div>

Hi,  
I am new to elastic search and I am trying to import data from csv to elasticsearch using logstash.  
I am using the below logstash conf file

input {  
file {  
path =\> ["D:/AnalyticsTool/Exe/logstash-5.2.0/logstash-5.2.0/bin/data.csv"]  
type =\> "core2"  
start\_position =\> "beginning"  
}  
}  
filter {  
csv {  
separator =\> ","  
columns =\> ["Date","Open","High","Low","Close","Volume","Adj Close"]  
}  
mutate {convert =\> ["High", "float"]}  
mutate {convert =\> ["Open", "float"]}  
mutate {convert =\> ["Low", "float"]}  
mutate {convert =\> ["Close", "float"]}  
mutate {convert =\> ["Volume", "float"]}  
}  
output {  
elasticsearch {  
action =\> "index"  
hosts =\> ["localhost:9200"]  
index =\> "stock"  
workers =\> 1  
user =\> elastic  
password =\> changeme  
}  
stdout { codec =\> rubydebug}  
}

I am not able to visualize in kibana. Do we need to create index manually in elastic search or kibana will create above mentioned index automatically ?  
Please let me know if I am missing anything

Thanks in advance

---

<div class="post-metadata">

**Author:** ![cbuescher](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cbuescher/32/60402_2.png) [@cbuescher](https://discuss.elastic.co/u/cbuescher)\
**Post date:** [February 13, 2017, 2:45pm UTC](https://discuss.elastic.co/t/import-csv-file-as-input-in-logstash-and-pass-the-output-data-to-elasticsearch/74893/2 "2017-02-13T14:45:13Z")

</div>

Hi,

It would be helpful to know where exactly you are stuck with this. Do you see any errors in Logstash? Is the index missing in Elasticsearch? Or is it just a visualization issue.

For example, to see if your "stock" index has been created you can try issue commands like:

curl [http://localhost:9200/\_cat/indices](http://localhost:9200/_cat/indices)  
curl [http://localhost:9200/stock/\_search](http://localhost:9200/stock/_search)

---

<div class="post-metadata">

**Author:** ![Uma\_Ananthu](https://avatars.discourse-cdn.com/v4/letter/u/bbce88/32.png) [@Uma\_Ananthu](https://discuss.elastic.co/u/Uma_Ananthu)\
**Post date:** [February 13, 2017, 2:53pm UTC](https://discuss.elastic.co/t/import-csv-file-as-input-in-logstash-and-pass-the-output-data-to-elasticsearch/74893/3 "2017-02-13T14:53:25Z")

</div>

Hi,  
Issue is resolved. Actually I missed to add sincedb in input section.

Thanks for your reply

---

<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 13, 2017, 2:53pm UTC](https://discuss.elastic.co/t/import-csv-file-as-input-in-logstash-and-pass-the-output-data-to-elasticsearch/74893/4 "2017-03-13T14:53:31Z")

</div>

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