adding the tags in the graylog output plugin

This commit is contained in:
Edie Zhang 2016-10-07 11:47:23 +11:00
parent 0af0fa7c2e
commit 268638db11
1 changed files with 7 additions and 0 deletions

View File

@ -226,6 +226,13 @@ func serialize(metric telegraf.Metric) ([]string, error) {
m["host"] = host
}
for key, value := range metric.Tags() {
nkey := fmt.Sprintf("_%s", key)
if key != "host" {
m[nkey] = value
}
}
for key, value := range metric.Fields() {
nkey := fmt.Sprintf("_%s", key)
m[nkey] = value