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

[Response Ops] [Alerting] Unflattening summarized alerts #147890

Merged
merged 4 commits into from
Dec 21, 2022

Conversation

ymao1
Copy link
Contributor

@ymao1 ymao1 commented Dec 20, 2022

Towards #147379

Summary

When investigating how to onboard detection alerts onto framework alert summaries, there were some discrepancies in the format of the alert documents returned. This PR fixes the formatting so it matches and there will be no difference in context.alerts when we migrate detection alerts to the framework.

Checklist

@ymao1 ymao1 changed the title Formatting summarized alerts [Response Ops] [Alerting] Unflattening summarized alerts Dec 20, 2022
@ymao1 ymao1 self-assigned this Dec 20, 2022
@ymao1 ymao1 added Feature:Alerting Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) Feature:Alerting/RulesFramework Issues related to the Alerting Rules Framework v8.7.0 labels Dec 20, 2022
@ymao1 ymao1 force-pushed the alerting/summary-alert-format branch from 60d23ea to 78c2c07 Compare December 20, 2022 21:37
@ymao1 ymao1 marked this pull request as ready for review December 21, 2022 13:19
@ymao1 ymao1 requested review from a team as code owners December 21, 2022 13:19
@elasticmachine
Copy link
Contributor

Pinging @elastic/response-ops (Team:ResponseOps)

@ymao1 ymao1 added the release_note:skip Skip the PR/issue when compiling release notes label Dec 21, 2022

const expandFlattenedAlert = (alert: object) => {
if (Array.isArray(alert)) {
return alert;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could an alert-as-data record be an array?
I though it's always like:

{
'kibana.alert.id':'5'
'kibana.alert.name':'name'
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably not. I took this from detection rules library functions 🙈. I can remove the check

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was going to check how security solutions did it :)

Copy link
Contributor

@ersin-erdal ersin-erdal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

Unknown metric groups

ESLint disabled in files

id before after diff
osquery 1 2 +1

ESLint disabled line counts

id before after diff
enterpriseSearch 19 21 +2
fleet 61 67 +6
osquery 109 115 +6
securitySolution 436 442 +6
total +20

Total ESLint disabled count

id before after diff
enterpriseSearch 20 22 +2
fleet 70 76 +6
osquery 110 117 +7
securitySolution 512 518 +6
total +21

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

cc @ymao1

@ymao1 ymao1 merged commit efb7cdd into elastic:main Dec 21, 2022
@ymao1 ymao1 deleted the alerting/summary-alert-format branch December 21, 2022 21:48
@kibanamachine kibanamachine added the backport:skip This commit does not require backporting label Dec 21, 2022
simianhacker pushed a commit to simianhacker/kibana that referenced this pull request Dec 22, 2022
)

Towards elastic#147379

## Summary

When investigating how to [onboard detection alerts onto framework alert
summaries](elastic#147379), there were
some discrepancies in the format of the alert documents returned. This
PR fixes the formatting so it matches and there will be no difference in
`context.alerts` when we migrate detection alerts to the framework.


### Checklist

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting Feature:Alerting/RulesFramework Issues related to the Alerting Rules Framework Feature:Alerting release_note:skip Skip the PR/issue when compiling release notes Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) v8.7.0
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

5 participants