Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass in configuration using environment variable #4376

Closed
xaka opened this issue Dec 20, 2015 · 2 comments
Closed

Pass in configuration using environment variable #4376

xaka opened this issue Dec 20, 2015 · 2 comments

Comments

@xaka
Copy link

xaka commented Dec 20, 2015

As we live in era where containers taking over place, it would be nice to assign configuration to environment variable, may be $LOGSTASH, and make sure logstash consumes it when no configuration file (-f) or configuration string (-e) is provided. The reason is pretty simple - I don't want to build my own image from base one just to inject some file nor I want to mess around with volumes nor I'm happy with -e because you end up with a long unreadable line and at the same, when you use docker compose for instance, you can come up with (take a look at magical pipe | supported by YAML):

image: logstash
environment:
  LOGSTASH: |
    input {
      ...
    }

Which is pretty readable and allows one to use existing official image.

@xaka
Copy link
Author

xaka commented Dec 20, 2015

For now I'm using the following workaround to stick to official image without need for building my own:

image: logstash
command: bash -c 'echo $$LOGSTASH > logstash.conf; exec logstash -f logstash.conf'
environment:
  LOGSTASH: |
    input {
      ...
    }

@suyograo
Copy link
Contributor

Fixed in #3944, will be available in 2.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants