Providing config files in docker command

I am trying to run logstash on docker by using the custom configuration for logstash.
Logstash for Docker was pulled using the following commands:

docker pull
docker pull

While configuring, I am using the following commands:

docker run --rm -it -v ~/pipeline/:/usr/share/logstash/pipeline/

docker run --rm -it -v ~/settings/logstash.yml:/usr/share/logstash/config/logstash.yml

I am trying to make use of my own configuration files (i.e) logstash.yml and logstash.conf from my machine.

I changed this command in many ways to pass my config files but something is not going fine. It is taking some default configuration and throwing the following error.

[WARN ][logstash.licensechecker.licensereader] Attempted to resurrect connection to dead ES instance, but got an error. {:url=>"http://logstash_system:xxxxxx@elasticsearch:9200/", :error_type=>LogStash::Outputs::ElasticSearch::HttpClient::Pool::HostUnreachableError, :error=>"Elasticsearch Unreachable: [http://logstash_system:xxxxxx@elasticsearch:9200/][Manticore::ResolutionFailure] elasticsearch"}

I am not redirecting the output to elasticsearch in my config provided but it is taking some configuration internally.

It would be of great help if someone can say, How to provide our config files and .yml file in this docker run command to execute.

Thanks in advance :slight_smile:

Are you sure ~ is expanded correctly? What volume mounts are present if you run docker inspect on the container?

Hi Magnus,

Actually I tried giving the path by giving both ways

  1. ~
  2. the expanded path (/home/ubuntu)

But still its not picking properly.

Since docker is not running, unable to find the volume mounts. I am not getting the exact command to check. Please help through with the command.

Thanks :slight_smile:

The container isn't starting? Why not? The log message above it just a warning.

Anyway, you can append bash to the end of the command to get a shell inside the container. From there you can explore what files you actually get in the directories in question.

Thanks Magnus. By adding bash at the end of the command, I was able to find the files in the provided directory. It is reaching there.

Is there a way to run logstash with this configuration inside docker?


Is there a way to run logstash with this configuration inside docker?

I don't know, but you can increase the logging verbosity via a command-line option and get more details about the configuration being loaded.

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