kovetskiy / zabbixctl

Most effective way for operating in Zabbix Server
MIT License
139 stars 28 forks source link

Search regex should be more intuitive #17

Open longpaul opened 6 years ago

longpaul commented 6 years ago

Example: zabbixctl -Tp -xx /mo

[DEBUG] * searching m.o

It grabs /home/kovetskiy for example... Not really useful.

I did a little hack in the code to get rid of it (src/github.com/kovetskiy/zabbixctl/search.go)

import (
        "regexp"
        "strings"
        "bytes"
)
...
    pattern := strings.Join(letters, "")

    list := []string{".*", pattern ,".*"}

    var str bytes.Buffer

    for _, l := range list {
            str.WriteString(l)
            }
    pattern = str.String()

You can use it, if you want