From 5494b9a65ab53fe578e126c2b7dbe972db847b5f Mon Sep 17 00:00:00 2001 From: Daniel Nelson Date: Fri, 4 May 2018 14:31:16 -0700 Subject: [PATCH] Only lowercase mysql slave metrics with metric_version = 2 --- plugins/inputs/mysql/mysql.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins/inputs/mysql/mysql.go b/plugins/inputs/mysql/mysql.go index a2be5848f..6e5a89e3b 100644 --- a/plugins/inputs/mysql/mysql.go +++ b/plugins/inputs/mysql/mysql.go @@ -608,7 +608,9 @@ func (m *Mysql) gatherSlaveStatuses(db *sql.DB, serv string, acc telegraf.Accumu } // range over columns, and try to parse values for i, col := range cols { - col = strings.ToLower(col) + if m.MetricVersion >= 2 { + col = strings.ToLower(col) + } if value, ok := m.parseValue(*vals[i].(*sql.RawBytes)); ok { fields["slave_"+col] = value }