How to load CSV file in logstash


(Lovika Jain) #1

Hi
I am trying to load CSV file in logstash but it is not reading the file and not creating the index in elasticsearch

My Config file
input {

file {
    type => "csv"
    path => "/root/installables/*.csv"
    start_position => beginning
}

}

filter {
grok {
match => { "message" => "%{COMBINEDAPACHELOG}" }
}
}
output {
elasticsearch {
hosts => localhost
index => "client"
}
}
Could anybody tell how to load CSV file in logstash?


(Magnus Bäck) #2

For one-shot imports of files where you don't need to support restarts of Logstash while the file is being processed I suggest you set sincedb_path => "/dev/null" for the file input or use the stdin input.

You should consult the file input documentation and read about sincedb files, because that's what's going on here; Logstash is waiting for more data to be added to the end of the file.

This question is very frequently asked so you'll find additional reading in the archives.


(Lovika Jain) #3

I already tried placing since_db , it is still now working!


(Magnus Bäck) #4

If you enable verbose logs by starting Logstash with --verbose you'll find more clues as to what's happening. We need those clues to debug the issue further.


(system) #6