-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
[Alerting] Write executionStatus property to kibana event log #79785
Comments
Pinging @elastic/kibana-alerting-services (Team:Alerting Services) |
This is a great idea. We'll need to find a place in ECS we can put this, or add a new extension field. I think we'd want to support the |
Here are the locations of some of the relevant spots in the code for this: in kibana/x-pack/plugins/alerts/server/task_runner/task_runner.ts Lines 346 to 355 in c4b8f4c
in kibana/x-pack/plugins/alerts/server/task_runner/task_runner.ts Lines 218 to 222 in c4b8f4c
and the call tree looks like:
However, |
Ya, looking to see how to refactor to do this and ... "it's complicated". :-) One thing that would be straight-forward to do, is to add an indication of "ok" | "active" - ie, there are no active instances | there are active instances. But at that point, it might as well be a field indicating the number of active instances, which would be Note that the other interesting case from the alert execution status is the error conditions, but errors will already be reported in the event anyway. It won't have the @dhurley14 thoughts? The use case described is to get failure information from the event log. I think some "errors" won't show up today in the event log, the If that's the case, another option is to generate a new type of event that would basically for "we wanted to run an alert, but before we could even try, there was an error, and this is what it was". |
Yeah this is what we've noticed is the decrypt errors aren't showing up in the event log.
I think focusing on the "errors" piece of this is the more important part from the security solution perspective. To know that there are longer running / really really long running rules that never seem to complete via the "ok / active" statuses would be great too but I think the priority is to have some queryable log of failures for the rules. We keep track within our rules of the "last five failures" which occur within the functions we run in our alert executor function as a saved object separate from the rule, but to be able to integrate historical failures from the event log + our custom "last five failures" queue would be a nice-to-have. |
At this point I'm wondering if an easy route is a new event type (ie, event I feel like we'll need something like this eventually anyway - there are too many things outside of the execution of alerts that can have "problems" that we don't have any way of reporting on via the event log, this would be way of getting them in. I wanna take another look at getting this into the |
resolves elastic#79785 Until now, the execution status was available in the the event log document for the execute action. In this PR we add it. The event log is extended to add the following fields: - `kibana.alerting.status` - from executionStatus.status - `event.reason` - from executionStatus.error.reason The date from the executionStatus and start date in the event log will be set to the same value. Previously, errors encountered while trying to execute an alert executor, eg decrypting the alert, would not end up with an event doc generated. Now they will. In addition, there were a few places where events that could have had the action group in them did not, and one where the instance id was undefined - those were fixed up.
) resolves #79785 Until now, the execution status was available in the the event log document for the execute action. In this PR we add it. The event log is extended to add the following fields: - `kibana.alerting.status` - from executionStatus.status - `event.reason` - from executionStatus.error.reason The date from the executionStatus and start date in the event log will be set to the same value. Previously, errors encountered while trying to execute an alert executor, eg decrypting the alert, would not end up with an event doc generated. Now they will. In addition, there were a few places where events that could have had the action group in them did not, and one where the instance id was undefined - those were fixed up.
…stic#82401) resolves elastic#79785 Until now, the execution status was available in the the event log document for the execute action. In this PR we add it. The event log is extended to add the following fields: - `kibana.alerting.status` - from executionStatus.status - `event.reason` - from executionStatus.error.reason The date from the executionStatus and start date in the event log will be set to the same value. Previously, errors encountered while trying to execute an alert executor, eg decrypting the alert, would not end up with an event doc generated. Now they will. In addition, there were a few places where events that could have had the action group in them did not, and one where the instance id was undefined - those were fixed up.
) (#83289) resolves #79785 Until now, the execution status was available in the the event log document for the execute action. In this PR we add it. The event log is extended to add the following fields: - `kibana.alerting.status` - from executionStatus.status - `event.reason` - from executionStatus.error.reason The date from the executionStatus and start date in the event log will be set to the same value. Previously, errors encountered while trying to execute an alert executor, eg decrypting the alert, would not end up with an event doc generated. Now they will. In addition, there were a few places where events that could have had the action group in them did not, and one where the instance id was undefined - those were fixed up.
Describe the feature:
The executionStatus property on alerting saved objects (introduced here #75553) is a view into the current execution status of a kibana alert. It would be nice if each executionStatus was written to the kibana event log index
.kibana-space-event-log-8.0.0
and we could query that for historical purposes.Describe a specific use case for the feature:
The security solution currently keeps track of failures in a list-like structure of saved objects. With the addition of the executionStatus property to kibana alerts, we now have to manage merging each executionStatus into our rule status failure tracking system. It would be nice if we had a separate place to query for historical executions of kibana alerts rather than having to pull it directly off of the alert.
The text was updated successfully, but these errors were encountered: