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

Add ability to override configuration settings using environment variables. #114

Closed
mingfang opened this issue Apr 9, 2015 · 9 comments
Closed

Comments

@mingfang
Copy link

mingfang commented Apr 9, 2015

I'm trying to deploy the packetbeat agent to a cluster of machines using kubernetes.
However the ElasticSearch hostname needs to be configurable at deployment time.
I would like the ability to set that using environment variables,
e.g.

export PACKETBEAT_ELASTICSEARCH_HOST=dynamic-host
@tsg
Copy link
Contributor

tsg commented Apr 10, 2015

Good suggestion, we'll add it.

@albanm
Copy link

albanm commented Apr 28, 2015

+1

How about using viper for a more complete config system ?

If you lack the time but are ok with the idea I am willing to attempt a pull request (total go newbie here, but this should not be too difficult).

andrewkroh added a commit that referenced this issue Dec 2, 2015
tsg added a commit that referenced this issue Dec 2, 2015
tsg added a commit that referenced this issue Dec 2, 2015
Update to most recent libbeat version and shared files
@yoanisgil
Copy link

I think this an excellent idea. I have a config file which looks like this:

filebeat:
  prospectors:
    -
      paths:
        - "/var/log/supervisor/nginx*.log"
      input_type: log
      fields:
        source: nginx
        level: info
        environment: development
output:
    console:
        pretty: true
    logstash:
        hosts: ["logstash.mpl.ninja:5044"]

and I would like to be able to configure the list of logstash hosts as well as the environment setting. The reason I need to do so is because I need to provide support for dev/staging/production environments the later 2 being AWS Beanstalk environments which are updated via Jenkins.

Anyone working on this? I could give a try if this is something you're willing to implement.

@ruflin
Copy link
Member

ruflin commented Dec 27, 2015

@yoanisgil As far as I know there is currently no one working on this. I somehow see the need for this especially for larger deployment but at the same time I'm worried about having one more unknown to debug, in case of issue. Right now we know exactly what the config file is.

@albanm I had a quick look at viper. Looks interesting, not sure if it is overkill for what we need.

Also have a look at #464

@mingfang
Copy link
Author

Until there is an official solution, this is my current hack https://github.com/mingfang/docker-packetbeat-agent/blob/master/sv/packetbeat/run#L8. It's nothing innovative; just a simple sed hack.
For a nicer solution I would use confd instead.

@yoanisgil
Copy link

@mingfang same on this side. I had to rely on sed as a work around.

@ruflin I guess we should wait and see if this feature request raises more interest from the community.

@ruflin
Copy link
Member

ruflin commented Dec 27, 2015

@mingfang I actually quite like this "hack" as it is simple and gets the job done.
@yoanisgil Agree

@andrewkroh
Copy link
Member

This feature was added. Please see #715 for details.

@yoanisgil
Copy link

Thanks guys for adding this feature!

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

6 participants