-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Add env vars to libbeat.yml default conf file #1419
Conversation
Jenkins standing by to test this. If you aren't a maintainer, you can ignore this comment. Someone with commit access, please review this and clear it for Jenkins to run; then say 'jenkins, test it'. |
Hi @marminthibaut. As I'm not too big of a fan of the environment variables, so I prefer not to have it in the default config as this would even encourage the usage. But that is my personal opinion, lets see what the rest of the team thinks. |
For Dockerbeat, we are generating a I see two solutions:
Any idea? |
I would then choose the second option. Perhaps it makes sense the we make the path to libbeat.yml configurable, so running One note here: We are discussing to potentially shorten the default configuration and only have the most important options in, as the config file gets longer and longer. This would simplify your task of keeping the files in sync. |
And what about having a libbeat template configuration file, then default On Tue, Apr 19, 2016, 1:57 PM Nicolas Ruflin [email protected]
|
The big question that brings that up, which option should we make configurable? An alternative idea: What you is basically overwrite the defaults. An alternative would be that we allow to overwrite the defaults on a code base. That means the variables would still be commented out but use the defaults you defined in the code of dockerbeat. If not commented out anymore, it will use the ones in the config file. The exception here is hosts ... |
@marminthibaut As @ruflin mentioned, we plan to reduce a bit the size of the default configurations: #1417 Since we'll keep just the very common options that are not likely to change too often, I think you don't have to use our libbeat.yml, but provide your own version, so you can add the env variables. |
config file handling is based on github.com/urso/ucfg. There are two features planed which might help in general:
CLI flag support is about merging command line flags into parsed configs -> CLI flags taking precedence. for example configuring the elasticsearch host can be done like this:
and reconfigure on start up beat using ES_HOST environment variable:
alternatively (using variable support) this can be shortened to:
and
I think this solution is a good compromise without having to resort on environment variable expansion in libbeat.yml by default. We might even consider merging multiple config files overwriting variables (but we've no particular plans for this feature). |
Jenkins standing by to test this. If you aren't a maintainer, you can ignore this comment. Someone with commit access, please review this and clear it for Jenkins to run; then say 'jenkins, test it'. |
@marminthibaut Did you find a solution on your side here? @urso is progressing on elastic/go-ucfg#14 which will give some interesting options, but it is not yet in libbeat. I will close this PR for the moment as we probably will not have environment variables in our default config. @marminthibaut Please feel free to reopen it if you think we should proceed here. |
Proposal to provide a default libbeat configuration with common environment variables defined.
What do you think about introducing these variables?
Thx!