Added ability to name alert rules

This commit is contained in:
Neil Lathwood
2014-12-21 15:44:50 +00:00
parent e867d3f1df
commit 51616844bc
5 changed files with 19 additions and 7 deletions
+1 -1
View File
@@ -23,6 +23,6 @@ if(is_numeric($alert_id) && $alert_id > 0) {
$rule_split = preg_split('/([a-zA-Z0-9_\-\.\=\%\ \"\'\!\~]+[&&||]+)/',$rule['rule'], -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY);
$count = count($rule_split) - 1;
$rule_split[$count] = $rule_split[$count].'&&';
$output = array('severity'=>$rule['severity'],'extra'=>$rule['extra'],'rules'=>$rule_split);
$output = array('severity'=>$rule['severity'],'extra'=>$rule['extra'],'name'=>$rule['name'],'rules'=>$rule_split);
echo _json_encode($output);
}