From 268638db114b7943ba02b892864c38489152ec43 Mon Sep 17 00:00:00 2001 From: Edie Zhang Date: Fri, 7 Oct 2016 11:47:23 +1100 Subject: [PATCH] adding the tags in the graylog output plugin --- plugins/outputs/graylog/graylog.go | 7 +++++++ 1 file changed, 7 insertions(+) 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