pblittle / docker-logstash

Docker image for Logstash 1.4
https://hub.docker.com/r/pblittle/docker-logstash
MIT License
237 stars 90 forks source link

Linking volumes for logstash.conf should create a copy of the conf file to edit #66

Closed cboettig closed 9 years ago

cboettig commented 9 years ago

If a user has a logstash.conf file that uses environmental variables like ES_HOST and links said file using the pattern recommended in the README:

 docker run -d \
  -v <your_logstash_config_dir>:/opt/logstash/conf.d \
...

then the container replaces the env vars with their true values. It seems not ideal for a conf file to be changed from the user's settings when the service is run. Clearly this doesn't happen if using a remote URL for the conf file, but it often makes more sense to link the file directly (e.g. plays nicely with branches which may have different versions of the conf file). Seems like it should be straight forward to simply copy the logstash.conf file first and edit that?

A related issue: docker let's you link files directly in the same way one would link volumes:

 docker run -d \
  -v <your_logstash_config_dir>/logstash.conf:/opt/logstash/conf.d/logstash.conf \
...

but for reasons that aren't clear to me, doing this instead of linking a directory causes the container to fail and exit. Any ideas? (Sorry if that should be a separate issue; but both things are pretty minor).

Thanks again for this great resource.

pblittle commented 9 years ago

@cboettig, do you think #69 created by @mikehaertl is similar to this issue?

cboettig commented 9 years ago

Sounds similar to me.

On Wed, Mar 4, 2015, 8:03 PM P. Barrett Little notifications@github.com wrote:

@cboettig https://github.com/cboettig, do you think #69 https://github.com/pblittle/docker-logstash/issues/69 created by @mikehaertl https://github.com/mikehaertl is similar to this issue?

— Reply to this email directly or view it on GitHub https://github.com/pblittle/docker-logstash/issues/66#issuecomment-77302828 .

mikehaertl commented 9 years ago

Oops, I missed this issue. It's really the same idea, so you can close #69. The only difference is, that I suggest to copy the complete directory. On the other hand: The documentation says, that it will include all config files from that directory, which never worked for me anyway. The file had to be named logstash.conf.

pblittle commented 9 years ago

@mikehaertl

On the other hand: The documentation says, that it will include all config files from that directory, which never worked for me anyway. The file had to be named logstash.conf

You definitely found a bug if all files in /opt/logstash/conf.d aren't being loaded.

https://github.com/pblittle/docker-logstash/blob/master/1.4/base/logstash.sh#L74-L112

I'll take a look at it and try to verify.

pblittle commented 9 years ago

@mikehaertl I wasn't able to reproduce this issue. I'm going to close it for now. Please reopen if you are still experiencing the problem.