From ba30e4f3da6e795cab22605e958d91f2e57124c2 Mon Sep 17 00:00:00 2001 From: jbergner Date: Mon, 18 May 2026 08:45:01 +0200 Subject: [PATCH] Status-Indikator Bugfix --- main.go | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) 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