Can you make sure this path is a logstash config file?

Hi guys,
Im a really novice guy working for first time with Logstash, Elasticsearch and Kibana. I created a logstash.conf file:

input{
stdin{}
}
output{
elasticsearch { hosts => ["elasticsearch:9200"] }
}

I created this file in the same path where I run the following command to create a container docker:

docker run -h logstash --name logstash --link elasticsearch:elasticsearch -it --rm -v "$PW D":/config-dir logstash -f ./logstash.conf
And this return the following:

20:28:48.062 [LogStash::Runner] INFO logstash.agent - No config files found in path {:path=>"/logstash.conf"}
20:28:48.068 [LogStash::Runner] ERROR logstash.agent - failed to fetch pipeline configuration {:message=>"No config files found: ./logstash.conf. Can you make sure this path is a logstash config file?"}

I tried with ./logstash.conf - /logstash.conf - logstash like parameter but nothing of this is working
I hope can you help me :slight_smile:
Regards!

You're mounting the current directory as /config-dir inside the container, but when Logstash starts in the container /config-dir isn't the current directory so ./logstash.conf can't be found. Passing /config-dir/logstash.conf to Logstash should work better.

1 Like

Hey Magnus! Really thanks!. That works for me. I created a config-dir folder and inside it, I created a logstash.conf file. Then, in the project root, I runned the following command:

docker run -h logstash --name logstash --link elasticsearch:elasticsearch -it --rm -v "$PWD":/config-dir logstash -f /confi g-dir/logstash.conf

Regards!

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