diff --git a/plugins/inputs/redis/redis.go b/plugins/inputs/redis/redis.go index 766463cfd4c43..cd438397c2318 100644 --- a/plugins/inputs/redis/redis.go +++ b/plugins/inputs/redis/redis.go @@ -18,7 +18,8 @@ import ( ) type Redis struct { - Servers []string + Servers []string + Password string tls.ClientConfig clients []Client @@ -59,6 +60,9 @@ var sampleConfig = ` ## If no port is specified, 6379 is used servers = ["tcp://localhost:6379"] + ## specify server password + # password = "s#cr@t%" + ## Optional TLS Config # tls_ca = "/etc/telegraf/ca.pem" # tls_cert = "/etc/telegraf/cert.pem" @@ -110,6 +114,9 @@ func (r *Redis) init(acc telegraf.Accumulator) error { password = pw } } + if len(r.Password) > 0 { + password = r.Password + } var address string if u.Scheme == "unix" {