From 041ac825522cae3b28375b98ae3ef24cdc9d793f Mon Sep 17 00:00:00 2001 From: Raphael Couto Date: Thu, 13 Dec 2018 17:57:03 -0200 Subject: [PATCH] Fix error sending empty tag value in azure monitor output (#5083) (cherry picked from commit f794d5b08adc74564153baeed7e47113ff6f4235) --- plugins/outputs/azure_monitor/azure_monitor.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/plugins/outputs/azure_monitor/azure_monitor.go b/plugins/outputs/azure_monitor/azure_monitor.go index 5c435ac0dbb9b..e52d66b991d9b 100644 --- a/plugins/outputs/azure_monitor/azure_monitor.go +++ b/plugins/outputs/azure_monitor/azure_monitor.go @@ -340,6 +340,10 @@ func hashIDWithTagKeysOnly(m telegraf.Metric) uint64 { h.Write([]byte(m.Name())) h.Write([]byte("\n")) for _, tag := range m.TagList() { + if tag.Key == "" || tag.Value == "" { + continue + } + h.Write([]byte(tag.Key)) h.Write([]byte("\n")) }