Skip to content

Commit

Permalink
Add means to specify server password for redis input (influxdata#4669)
Browse files Browse the repository at this point in the history
  • Loading branch information
glinton authored and Jean-Louis Dupond committed Apr 22, 2019
1 parent 4082e7d commit db403b9
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion plugins/inputs/redis/redis.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ import (
)

type Redis struct {
Servers []string
Servers []string
Password string
tls.ClientConfig

clients []Client
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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" {
Expand Down

0 comments on commit db403b9

Please sign in to comment.