diff --git a/plugins/inputs/redis/redis.go b/plugins/inputs/redis/redis.go index 40f059ce8..d17e7a845 100644 --- a/plugins/inputs/redis/redis.go +++ b/plugins/inputs/redis/redis.go @@ -254,10 +254,10 @@ func gatherInfoOutput( val := strings.TrimSpace(parts[1]) // Some percentage values have a "%" suffix that we need to get rid of before int/float conversion - num_val := strings.TrimSuffix(val, "%") + val = strings.TrimSuffix(val, "%") // Try parsing as int - if ival, err := strconv.ParseInt(num_val, 10, 64); err == nil { + if ival, err := strconv.ParseInt(val, 10, 64); err == nil { switch name { case "keyspace_hits": keyspace_hits = ival @@ -272,7 +272,7 @@ func gatherInfoOutput( } // Try parsing as a float - if fval, err := strconv.ParseFloat(num_val, 64); err == nil { + if fval, err := strconv.ParseFloat(val, 64); err == nil { fields[metric] = fval continue }