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 otherpirate committed Mar 15, 2019
1 parent 2521df2 commit 8839da9
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 8839da9

Please sign in to comment.