Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[postoverflow] Reinject meta into overflown state #2502

12 changes: 12 additions & 0 deletions cmd/crowdsec/output.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,18 @@
log.Printf("[%s] is whitelisted, skip.", *event.Overflow.Alert.Message)
continue
}
/* Inject postoverflow meta into the overflown state*/
for key, value := range event.Meta {
kv := &models.MetaItems0{
Key: key,
Value: value,
}
for _, alert := range event.Overflow.APIAlerts {
for _, event := range alert.Events {
event.Meta = append(event.Meta, kv)
}

Check warning on line 181 in cmd/crowdsec/output.go

View check run for this annotation

Codecov / codecov/patch

cmd/crowdsec/output.go#L174-L181

Added lines #L174 - L181 were not covered by tests
}
}
if event.Overflow.Reprocess {
log.Debugf("Overflow being reprocessed.")
input <- event
Expand Down
Loading