Change [tags] to [global_tags] to deal with toml bug

closes #662
This commit is contained in:
Cameron Sparr
2016-02-08 15:56:43 -07:00
parent b55a93a3e1
commit 6b06a23102
5 changed files with 9 additions and 8 deletions

View File

@@ -138,7 +138,7 @@ var header = `# Telegraf configuration
# file would generate.
# Global tags can be specified here in key="value" format.
[tags]
[global_tags]
# dc = "us-east-1" # will tag all metrics with dc=us-east-1
# rack = "1a"
@@ -333,9 +333,9 @@ func (c *Config) LoadConfig(path string) error {
log.Printf("Could not parse [agent] config\n")
return err
}
case "tags":
case "global_tags", "tags":
if err = config.UnmarshalTable(subTable, c.Tags); err != nil {
log.Printf("Could not parse [tags] config\n")
log.Printf("Could not parse [global_tags] config\n")
return err
}
case "outputs":

View File

@@ -20,7 +20,7 @@
# with 'required'. Be sure to edit those to make this configuration work.
# Tags can also be specified via a normal map, but only one form at a time:
[tags]
[global_tags]
dc = "us-east-1"
# Configuration for telegraf agent