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
|
||||
var servtag string
|
||||
if strings.Contains(serv, "@") {
|
||||
servtag = strings.Split(serv, "@")[1]
|
||||
servSplit := strings.Split(serv, "@")
|
||||
servtag = servSplit[len(servSplit) - 1] //last item
|
||||
} else if serv == "" {
|
||||
servtag = "localhost"
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue