Read csv file automatically without using 'logstash -f'

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

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

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

yes. but you have to setup config file

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

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

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)

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.

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