-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Description
Describe the bug
The threshold property to create an Incident from a correlation has a particularly implementation. When the threshold is > 1 the Incident is created with this first alert and put on hold until the upcoming alerts come in. This behavior makes feasible, for instance, to launch the "On Create" WF with the second alert instead the first (for a threshold = 2).
The principal issue is that the alert could be hidden because of this.
On the one hand, it's clear that in the Incidents, the incident won't be stay there, because is a germ-incident, not an incident itself.
On the other hand, if we filter the Feed by incident.id==null, the alert (which cause that germ-incident) won't be there, due to the alert has a real Incident in the data base.
In order to solve this problem, the solution would be having a filter like (incident.id==null || incident.is_visible == false). Nevertheless, the incident.is_visible is "wrapping" with this patter matching:
FieldMappingConfiguration(
map_from_pattern="alert.*",
map_to=["JSON(alertenrichment.enrichments).*", "JSON(alert.event).*"],
),in keep/api/core/incidents.py
To Reproduce
Steps to reproduce the behavior:
- Create a correlation with threshold > 1.
- Send 1 alert that matches with the previous correlation.
- Filter by incident.id == null in Feed
- Try to filter by incident.is_visible == false
Expected behavior
The expected behavior is having a consistence in the Feed when the preset tries to show only the alerts without incidents.