feat: match Bell rules and link alerts to events (#19)

This commit is contained in:
QiuSW
2026-08-12 18:03:11 +08:00
parent 55d54d06db
commit d55026902f
21 changed files with 623 additions and 9 deletions
+36
View File
@@ -0,0 +1,36 @@
package model
import "encoding/json"
type Alert struct {
ID string `json:"id"`
Status string `json:"status"`
Severity string `json:"severity"`
Summary string `json:"summary"`
Location string `json:"location"`
PrimaryRuleID string `json:"primary_rule_id"`
RuleName string `json:"rule_name"`
EventCount int `json:"event_count"`
CreatedAt string `json:"created_at"`
UpdatedAt string `json:"updated_at"`
}
type LinkedEvent struct {
ID string `json:"id"`
EventType string `json:"event_type"`
OccurredAt string `json:"occurred_at"`
Location string `json:"location"`
Severity string `json:"severity"`
}
type Match struct {
EventID string `json:"event_id"`
RuleID string `json:"rule_id"`
RuleVersion int `json:"rule_version"`
RuleSnapshot json.RawMessage `json:"rule_snapshot"`
Explanation string `json:"explanation"`
MatchedAt string `json:"matched_at"`
}
type Detail struct {
Alert Alert `json:"alert"`
Events []LinkedEvent `json:"events"`
Matches []Match `json:"matches"`
}