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

@ -7,6 +7,7 @@
### Bugfixes
- [#443](https://github.com/influxdata/telegraf/issues/443): Fix Ping command timeout parameter on Linux.
- [#662](https://github.com/influxdata/telegraf/pull/667): Change `[tags]` to `[global_tags]` to fix multiple-plugin tags bug.
## v0.10.2 [2016-02-04]

View File

@ -9,9 +9,9 @@ To generate a file with specific inputs and outputs, you can use the
-input-filter and -output-filter flags:
`telegraf -sample-config -input-filter cpu:mem:net:swap -output-filter influxdb:kafka`
## `[tags]` Configuration
## `[global_tags]` Configuration
Global tags can be specific in the `[tags]` section of the config file in
Global tags can be specific in the `[global_tags]` section of the config file in
key="value" format. All metrics being gathered on this host will be tagged
with the tags specified here.
@ -76,7 +76,7 @@ measurements at a 10s interval and will collect per-cpu data, dropping any
fields which begin with `time_`.
```toml
[tags]
[global_tags]
dc = "denver-1"
[agent]

View File

@ -10,7 +10,7 @@
# 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"

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