Skip to content

Commit

Permalink
adding the tags in the graylog output plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
Edie Zhang committed Oct 7, 2016
1 parent 0af0fa7 commit 268638d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions plugins/outputs/graylog/graylog.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 268638d

Please sign in to comment.