This commit is contained in:
@@ -1290,4 +1290,26 @@ VALUES
|
|||||||
0,
|
0,
|
||||||
86400,
|
86400,
|
||||||
0
|
0
|
||||||
);
|
);
|
||||||
|
|
||||||
|
UPDATE detection_rules
|
||||||
|
SET description = ''
|
||||||
|
WHERE description IS NULL;
|
||||||
|
|
||||||
|
UPDATE detection_rules
|
||||||
|
SET match_field = ''
|
||||||
|
WHERE match_field IS NULL;
|
||||||
|
|
||||||
|
UPDATE detection_rules
|
||||||
|
SET match_operator = ''
|
||||||
|
WHERE match_operator IS NULL;
|
||||||
|
|
||||||
|
UPDATE detection_rules
|
||||||
|
SET match_value = ''
|
||||||
|
WHERE match_value IS NULL;
|
||||||
|
|
||||||
|
ALTER TABLE detection_rules
|
||||||
|
MODIFY description TEXT NULL,
|
||||||
|
MODIFY match_value TEXT NULL,
|
||||||
|
MODIFY match_field VARCHAR(64) NOT NULL DEFAULT '',
|
||||||
|
MODIFY match_operator VARCHAR(16) NOT NULL DEFAULT '';
|
||||||
19
main.go
19
main.go
@@ -761,10 +761,21 @@ func main() {
|
|||||||
|
|
||||||
func (s *server) listDynamicRules(ctx context.Context) ([]DynamicRule, error) {
|
func (s *server) listDynamicRules(ctx context.Context) ([]DynamicRule, error) {
|
||||||
const q = `
|
const q = `
|
||||||
SELECT id, name, description, severity, channel, event_ids,
|
SELECT id,
|
||||||
match_field, match_operator, match_value,
|
name,
|
||||||
threshold_count, threshold_window_seconds, suppress_for_seconds,
|
COALESCE(description, ''),
|
||||||
enabled, created_at, updated_at
|
severity,
|
||||||
|
channel,
|
||||||
|
event_ids,
|
||||||
|
COALESCE(match_field, ''),
|
||||||
|
COALESCE(match_operator, ''),
|
||||||
|
COALESCE(match_value, ''),
|
||||||
|
threshold_count,
|
||||||
|
threshold_window_seconds,
|
||||||
|
suppress_for_seconds,
|
||||||
|
enabled,
|
||||||
|
created_at,
|
||||||
|
updated_at
|
||||||
FROM detection_rules
|
FROM detection_rules
|
||||||
ORDER BY name ASC
|
ORDER BY name ASC
|
||||||
`
|
`
|
||||||
|
|||||||
Reference in New Issue
Block a user