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

Support default config paths #1122

Merged
merged 1 commit into from
Apr 29, 2016
Merged

Support default config paths #1122

merged 1 commit into from
Apr 29, 2016

Conversation

sparrc
Copy link
Contributor

@sparrc sparrc commented Apr 28, 2016

precedence will be:

  1. --config command-line option
  2. $TELEGRAF_CONFIG_PATH
  3. $HOME/.telegraf/telegraf.conf
  4. /etc/telegraf/telegraf.conf

@sparrc
Copy link
Contributor Author

sparrc commented Apr 28, 2016

cc @jsternberg @beckettsean @jwilder @e-dard

this is for Telegraf to support the same default config paths as influxdb on startup (see influxdata/influxdb#6444)

@sparrc sparrc force-pushed the default-config-paths branch 3 times, most recently from c61de5f to 78ad441 Compare April 28, 2016 22:37
} else {
fmt.Println("You must specify a config file. See telegraf --help")
// If no other options are specified, load the config file and run.
var c *config.Config
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can just do this:

c := config.NewConfig()

And that will reduce one line.

@sparrc sparrc force-pushed the default-config-paths branch 3 times, most recently from 6283b94 to 99bd5d1 Compare April 28, 2016 23:35
@jsternberg
Copy link
Contributor

👍

precedence will be:

 1. --config command-line option
 2. $TELEGRAF_CONFIG_PATH
 3. $HOME/.telegraf/telegraf.conf
 4. /etc/telegraf/telegraf.conf
@sparrc sparrc merged commit cbe32c7 into master Apr 29, 2016
@sparrc sparrc deleted the default-config-paths branch April 29, 2016 15:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants