Skip to content

Commit db403b9

Browse files
glintonJean-Louis Dupond
authored andcommitted
Add means to specify server password for redis input (influxdata#4669)
1 parent 4082e7d commit db403b9

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

plugins/inputs/redis/redis.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ import (
1818
)
1919

2020
type Redis struct {
21-
Servers []string
21+
Servers []string
22+
Password string
2223
tls.ClientConfig
2324

2425
clients []Client
@@ -59,6 +60,9 @@ var sampleConfig = `
5960
## If no port is specified, 6379 is used
6061
servers = ["tcp://localhost:6379"]
6162
63+
## specify server password
64+
# password = "s#cr@t%"
65+
6266
## Optional TLS Config
6367
# tls_ca = "/etc/telegraf/ca.pem"
6468
# tls_cert = "/etc/telegraf/cert.pem"
@@ -110,6 +114,9 @@ func (r *Redis) init(acc telegraf.Accumulator) error {
110114
password = pw
111115
}
112116
}
117+
if len(r.Password) > 0 {
118+
password = r.Password
119+
}
113120

114121
var address string
115122
if u.Scheme == "unix" {

0 commit comments

Comments
 (0)