split host@addr:port
This commit is contained in:
parent
f1f38601d5
commit
5c45a79d12
3 changed files with 8 additions and 3 deletions
|
@ -11,5 +11,6 @@ docker run \
|
|||
-r 192.168.0.1:6379 \
|
||||
-m 192.168.0.1:27017 \
|
||||
-d lastlogin \
|
||||
-i test@10.39.253.206:8086 \
|
||||
-T 80s \
|
||||
$@
|
||||
|
|
|
@ -15,7 +15,8 @@ var (
|
|||
|
||||
func writeStats(start time.Time) {
|
||||
if opts.Debug {
|
||||
fmt.Printf("writing to influxdb server: %s", opts.Influxdb)
|
||||
fmt.Printf("writing to influxdb server: %s\n", opts.Influxdb)
|
||||
fmt.Printf("host: %s -- addr: %s\n", infhost, infdb)
|
||||
}
|
||||
|
||||
c, err := influxdb.NewHTTPClient(influxdb.HTTPConfig{
|
||||
|
|
7
main.go
7
main.go
|
@ -14,7 +14,7 @@ import (
|
|||
)
|
||||
|
||||
const (
|
||||
_Version = "v5.0.0b2"
|
||||
_Version = "v5.0.0b3"
|
||||
_Producer = 0
|
||||
_Consumer = 1
|
||||
_Remover = 2
|
||||
|
@ -55,8 +55,11 @@ func main() {
|
|||
// re, _ := regexp.Compile(`(\w+)@(\d+.\d+.\d+.\d+:\d+)`)
|
||||
if re.MatchString(opts.Influxdb) {
|
||||
match := re.FindStringSubmatch(opts.Influxdb)
|
||||
if opts.Debug {
|
||||
fmt.Printf("Influxdb match: %+v\n", match)
|
||||
}
|
||||
infhost = match[1]
|
||||
infdb = match[2]
|
||||
infdb = match[2] + ":" + match[3]
|
||||
} else {
|
||||
opts.Influxdb = ""
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue