# Read csv file automatically without using 'logstash -f'

**URL:** https://discuss.elastic.co/t/read-csv-file-automatically-without-using-logstash-f/214298
**Category:** Logstash
**Created:** [January 8, 2020, 7:55pm UTC](https://discuss.elastic.co/t/read-csv-file-automatically-without-using-logstash-f/214298 "2020-01-08T19:55:21Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![kumar4](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kumar4/32/48326_2.png) [@kumar4](https://discuss.elastic.co/u/kumar4)
#### Post date: [January 8, 2020, 7:55pm UTC](https://discuss.elastic.co/t/read-csv-file-automatically-without-using-logstash-f/214298/1 "2020-01-08T19:55:21Z")

</div>

hello, i have a csv file that i view on kibana (i have already created an index), the problem is that every time i have to type the command 'logstash -f myfile.csv', I want to automate this task, that is to say that the file is read automatically without typing this command  
thank you a lot

---

<div class="post-metadata">

### Author: ![elasticforme](https://avatars.discourse-cdn.com/v4/letter/e/f05b48/32.png) [@elasticforme](https://discuss.elastic.co/u/elasticforme)
#### Post date: [January 8, 2020, 8:57pm UTC](https://discuss.elastic.co/t/read-csv-file-automatically-without-using-logstash-f/214298/2 "2020-01-08T20:57:27Z")

</div>

that means you need to setup pipeline

assuming you have elasticsearch/logstash install in linux machine  
you have to copy your csv file to certain location.

and from there it will be read automatically

for example you create dir on your linux machine /tmp/csvfiles

copy your csv files there

setup /etc/logstash/pipelines.yml file  
pipeline.id: csvread  
path.config: "/etc/logstash/conf.d/csvread.conf"  
pipeline.workerts: 1

setup your csvread.conf file (which will read this csv)

start logstash daemon

---

<div class="post-metadata">

### Author: ![kumar4](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kumar4/32/48326_2.png) [@kumar4](https://discuss.elastic.co/u/kumar4)
#### Post date: [January 8, 2020, 9:00pm UTC](https://discuss.elastic.co/t/read-csv-file-automatically-without-using-logstash-f/214298/3 "2020-01-08T21:00:41Z")

</div>

tanhk your for your response; so if i add some lines to my csv, it will appear in kibana automatically ?

---

<div class="post-metadata">

### Author: ![elasticforme](https://avatars.discourse-cdn.com/v4/letter/e/f05b48/32.png) [@elasticforme](https://discuss.elastic.co/u/elasticforme)
#### Post date: [January 8, 2020, 9:07pm UTC](https://discuss.elastic.co/t/read-csv-file-automatically-without-using-logstash-f/214298/4 "2020-01-08T21:07:32Z")

</div>

yes. but you have to setup config file

csvread.conf with  
input {}  
filter{}  
output{}

---

<div class="post-metadata">

### Author: ![kumar4](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kumar4/32/48326_2.png) [@kumar4](https://discuss.elastic.co/u/kumar4)
#### Post date: [January 8, 2020, 9:17pm UTC](https://discuss.elastic.co/t/read-csv-file-automatically-without-using-logstash-f/214298/5 "2020-01-08T21:17:41Z")

</div>

yes i already have one (that i use with logstash -f csvread.conf)in wich i declare the path of csv the columns ..., and now i will setup the pipline

---

<div class="post-metadata">

### Author: ![ITIC](https://avatars.discourse-cdn.com/v4/letter/i/90ced4/32.png) [@ITIC](https://discuss.elastic.co/u/ITIC)
#### Post date: [January 9, 2020, 7:09am UTC](https://discuss.elastic.co/t/read-csv-file-automatically-without-using-logstash-f/214298/6 "2020-01-09T07:09:19Z")

</div>

Hi

Could you post the code to that `csvread.conf` file of yours? That way we might be able to help you debug your implementetion.

Have you checked the documentation for the `file{}` input? ([https://www.elastic.co/guide/en/logstash/current/plugins-inputs-file.html](https://www.elastic.co/guide/en/logstash/current/plugins-inputs-file.html))

I think you can set your `logstash` instance up in such a way that it will be permanently listening for changes on your `.csv` file.

Hope this helps.

---

<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: [February 6, 2020, 7:10am UTC](https://discuss.elastic.co/t/read-csv-file-automatically-without-using-logstash-f/214298/7 "2020-02-06T07:10:59Z")

</div>

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