diff --git a/plugins/outputs/graylog/graylog.go b/plugins/outputs/graylog/graylog.go index 7f2480134..a8f4bd071 100644 --- a/plugins/outputs/graylog/graylog.go +++ b/plugins/outputs/graylog/graylog.go @@ -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