# Feed Data to Elastic Serach Via Logstash using CSV

**URL:** <https://discuss.elastic.co/t/feed-data-to-elastic-serach-via-logstash-using-csv/38400>\
**Category:** Logstash\
**Created:** [January 5, 2016, 12:18pm UTC](https://discuss.elastic.co/t/feed-data-to-elastic-serach-via-logstash-using-csv/38400 "2016-01-05T12:18:23Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![sharan\_jain](https://avatars.discourse-cdn.com/v4/letter/s/e495f1/32.png) [@sharan\_jain](https://discuss.elastic.co/u/sharan_jain)\
**Post date:** [January 5, 2016, 12:18pm UTC](https://discuss.elastic.co/t/feed-data-to-elastic-serach-via-logstash-using-csv/38400/1 "2016-01-05T12:18:23Z")

</div>

Hi Team ,

I am using Logstast To read the data from CSV file and Output to Elastic search .

Below is Conf File :

input {  
file {  
path =\> "/opt/app/data/TC\_Export\_CSV.csv"  
start\_position =\> "beginning"  
}  
}

filter {  
csv {  
columns =\> ["ColumnA", "ColumnB", "ColumnC", "ColumnD"]  
separator =\> ","  
}  
}

output {  
elasticsearch {  
index=\>tc\_export\_csv  
}  
stdout {}  
}

Running Command

bin/logstash -f /opt/app/data/TC\_Export.conf

> bin/logstash -f /opt/app/nft/data/TC\_Export.conf  
> Settings: Default filter workers: 1  
> Logstash startup completed

After That nothing happens.  
Conf :  
logstash-2.1.0  
elasticsearch-2.1.1  
kibana-4.3.1-linux-x64

Sample CSv File :

Core,Run,123456,987654  
NonCore,No Run,225588,996633

Can you Please Help.

---

<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:** [January 5, 2016, 1:33pm UTC](https://discuss.elastic.co/t/feed-data-to-elastic-serach-via-logstash-using-csv/38400/2 "2016-01-05T13:33:24Z")

</div>

The file input is waiting for more data to be appended to TC\_Export\_CSV.csv. Because the file has seen before, `start_position => "beginning"` isn't effective. To make sure you start reading the file from the beginning, set `sincedb_path => "/dev/null"` as well. See the file input documentation for more information about sincedb.

---

<div class="post-metadata">

**Author:** ![sharan\_jain](https://avatars.discourse-cdn.com/v4/letter/s/e495f1/32.png) [@sharan\_jain](https://discuss.elastic.co/u/sharan_jain)\
**Post date:** [January 5, 2016, 5:53pm UTC](https://discuss.elastic.co/t/feed-data-to-elastic-serach-via-logstash-using-csv/38400/3 "2016-01-05T17:53:36Z")

</div>

Thanks Mag ,

Include the statement in Input .  
Now Logstash is not getting shutdown .

it display the records in csv and then nothing is happening .

By Running :  
bin/logstash -f /opt/app/data/TC\_Export.conf

---

<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:** [January 5, 2016, 6:50pm UTC](https://discuss.elastic.co/t/feed-data-to-elastic-serach-via-logstash-using-csv/38400/4 "2016-01-05T18:50:35Z")

</div>

Again, the file input is waiting for more data to be appended to TC\_Export\_CSV.csv. Logstash does not shut down just because it's done with the file. For batch processing of files you might find the stdin input more useful. Alternatively, use the method described in [http://stackoverflow.com/a/33146636/414355](http://stackoverflow.com/a/33146636/414355) to detect when a file has been processed fully.

---

<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, 5:16am UTC](https://discuss.elastic.co/t/feed-data-to-elastic-serach-via-logstash-using-csv/38400/5 "2017-07-06T05:16:45Z")

</div>


