Import a csv into ElasticSearch using logstash - Windows

I am trying to import a csv into ElasticSearch using logstash - Windows but receive the following error

Error: No config files found

Command I run is

logstash -f agent logstash-simple.conf

The config is as follows:

input {
stdin {
type => "stdin-type"
}
file {
path => ["C:/Program Files/ElasticSearch/sample.csv"]
start_position => "beginning"
}
}

filter {
csv {
columns => ["Name","Year"]
separator => ","
}
}

output {

elasticsearch { action => "index",
host => "localhost",
index => "customer",
workers => 1 }

}

1 Like
logstash -f agent logstash-simple.conf

You're asking Logstash to load a config file named "agent". Do this instead:

logstash -f logstash-simple.conf

Tried this and still receive the same error message.

Can you make sure this path is a logstash config file?
You may be interested in the '--configtest; flag which you can use to validate logstash's configuration before you choose to restart a running system.

Below code is working for me. Remove commas in output.
input {
stdin {
type => "stdin-type"
}
file {
path => ["C:/Program Files/ElasticSearch/sample.csv"]
start_position => "beginning"
}
}

filter {
csv {
columns => ["Name","Year"]
separator => ","
}
}

output {

elasticsearch_http {
host => "localhost:9200"
index => "customer"
}

}

I had the same problem. Try changing host to hosts in your output.