Ignore format

Filter regex with the following string format
"name=<deviceName>;type=<deviceType>;protocol=<deviceProtocol>"

Signed-off-by: tekert <tekert@gmail.com>
This commit is contained in:
tekert 2023-07-23 13:21:31 -03:00
parent 43abcf3728
commit 86c7aef620

View file

@ -93,7 +93,9 @@ func scanDevices(logger log.Logger) []string {
deviceName := d.Get("name").String() deviceName := d.Get("name").String()
deviceType := d.Get("type").String() deviceType := d.Get("type").String()
deviceProtocol := d.Get("protocol").String() deviceProtocol := d.Get("protocol").String()
if filter.ignored(deviceName) || filter.ignored(deviceType) || filter.ignored(deviceProtocol) { // filter schema "name=<deviceName>;type=<deviceType>;protocol=<deviceProtocol>"
device := "name=" + deviceName + ";type=" + deviceType + ";protocol=" + deviceProtocol
if filter.ignored(device) {
level.Info(logger).Log("msg", "Ignoring device", "name", deviceName, "type", deviceType, "protocol", deviceProtocol) level.Info(logger).Log("msg", "Ignoring device", "name", deviceName, "type", deviceType, "protocol", deviceProtocol)
} else { } else {
level.Info(logger).Log("msg", "Found device", "name", deviceName, "type", deviceType, "protocol", deviceProtocol) level.Info(logger).Log("msg", "Found device", "name", deviceName, "type", deviceType, "protocol", deviceProtocol)