fix "password contains '@'" bug
https://github.com/influxdb/telegraf/issues/297
This commit is contained in:
parent
2f08577967
commit
a60977710b
|
@ -132,7 +132,8 @@ func (m *Mysql) gatherServer(serv string, acc plugins.Accumulator) error {
|
||||||
// Parse out user/password from server address tag if given
|
// Parse out user/password from server address tag if given
|
||||||
var servtag string
|
var servtag string
|
||||||
if strings.Contains(serv, "@") {
|
if strings.Contains(serv, "@") {
|
||||||
servtag = strings.Split(serv, "@")[1]
|
servSplit := strings.Split(serv, "@")
|
||||||
|
servtag = servSplit[len(servSplit) - 1] //last item
|
||||||
} else if serv == "" {
|
} else if serv == "" {
|
||||||
servtag = "localhost"
|
servtag = "localhost"
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue