Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add means to specify server password for redis input #4669

Merged
merged 2 commits into from
Sep 10, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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