diff --git a/main.go b/main.go index 8b8969d..bf3aaa7 100644 --- a/main.go +++ b/main.go @@ -1220,7 +1220,7 @@ type Detection struct { Details json.RawMessage `json:"details_json"` CreatedAt time.Time `json:"created_at"` - Status string + Status string `json:"status"` AnalystNote string ReviewedBy string ReviewedAt sql.NullTime @@ -6316,10 +6316,16 @@ func (d *detector) insertDetection(ctx context.Context, det Detection) (bool, er if suppressed { return false, nil } + var status0 string + if det.Status == "plausible" { + status0 = "plausible" + } else { + status0 = "open" + } const q = ` INSERT IGNORE INTO detections -(rule_name, severity, hostname, channel_name, event_id, score, window_start, window_end, summary, details_json, created_at) +(rule_name, severity, hostname, channel_name, event_id, score, window_start, window_end, summary, details_json, created_at, status) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, UTC_TIMESTAMP(6)) ` @@ -6334,6 +6340,8 @@ VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, UTC_TIMESTAMP(6)) det.WindowEnd.UTC(), det.Summary, string(det.Details), + string(det.Status), + status0, ) if err != nil { return false, err