mirror of
https://github.com/stylersnico/librenms.git
synced 2026-07-28 08:02:41 +02:00
Add RegEx support to alert rules and device groups
This commit is contained in:
@@ -91,7 +91,7 @@ function GenSQL($rule) {
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
$sql = "SELECT * FROM ".implode(",",$tables)." WHERE (".$join."".str_replace("(","",$tables[0]).".device_id = ?) && (".str_replace(array("%","@","!~","~"),array("","%","NOT LIKE","LIKE"),$rule).")";
|
||||
$sql = "SELECT * FROM ".implode(",",$tables)." WHERE (".$join."".str_replace("(","",$tables[0]).".device_id = ?) && (".str_replace(array("%","@","!~","~"),array("",".*","NOT REGEXP","REGEXP"),$rule).")";
|
||||
return $sql;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user