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

[ResponseOps] change event log to use a datastream #154664

Merged
merged 3 commits into from
Jun 7, 2023

Conversation

pmuellr
Copy link
Member

@pmuellr pmuellr commented Apr 10, 2023

Summary

resolves #62677

Changes event log from using indices, aliases, and ILM manually, to using data streams.

In general for the event log, we create a new set of indices / aliases / index template for each stack version. And then when we search over all event logs, we use a wildcard pattern to include all the existing versions. That continues with this PR. Just instead of creating indices / aliases for a new version, we create a data stream.

Existing event log indices / aliases are left alone, since the current way to search over existing event logs is with a wildcard. For instance, .kibana-event-log-8.7.0 is the alias for 8.7.0 and .kibana-event-log-8.9.0 will be the data stream for 8.9.0. Searches over the event log are done using the index pattern .kibana-event-log-*, so will search over all the aliases and data streams.

Rolling back versions isn't a problem - the "new" resources created on the migration to a newer version, would only ever be referenced by search, if the deployment was rolled back to a previous verison. The existing indices / aliases / data streams for that version are left intact, the same structure they were in the release they were created in.

To test

The basic test is to ensure the event log is stil operational. You can do by checking the history tab of a running rule, which works off the event log.

To make sure we can still see old events from the older aliases / indices, you should actually start with an older version, create a rule and start it running, note the time the rule was started. Then migrate that deployment to this PR. Once Kibana comes up, check that the rule history still includes the run from the previous verison.

Checklist

Delete any items that are not applicable to this PR.

@pmuellr pmuellr force-pushed the event-log/use-datastreams-2 branch 2 times, most recently from 18eb3a3 to eebd310 Compare April 11, 2023 17:43
@pmuellr
Copy link
Member Author

pmuellr commented Apr 12, 2023

@elasticmachine merge upstream

@pmuellr pmuellr force-pushed the event-log/use-datastreams-2 branch from 4b847e2 to ce8cb4c Compare April 12, 2023 18:15
@pmuellr pmuellr changed the title change event log to use a datastream - 2nd attempt change event log to use a datastream Apr 12, 2023
@pmuellr pmuellr changed the title change event log to use a datastream [ResponseOps] change event log to use a datastream Apr 12, 2023
@pmuellr pmuellr force-pushed the event-log/use-datastreams-2 branch 2 times, most recently from 1a999ea to 92f264e Compare April 13, 2023 18:49
@pmuellr pmuellr added Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) Feature:EventLog backport:skip This commit does not require backporting 8.9 candidate labels Apr 13, 2023
@pmuellr pmuellr marked this pull request as ready for review April 13, 2023 21:34
@pmuellr pmuellr requested review from a team as code owners April 13, 2023 21:34
@elasticmachine
Copy link
Contributor

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

@pmuellr pmuellr added the release_note:skip Skip the PR/issue when compiling release notes label Apr 13, 2023
@mikecote
Copy link
Contributor

@pmuellr I found this issue #62677 and linked your PR to resolve it when merged.

@pmuellr pmuellr marked this pull request as draft May 4, 2023 00:25
@pmuellr
Copy link
Member Author

pmuellr commented May 4, 2023

Converted to a draft - shouldn't have taken it out of draft! :-)

I've got to add a scheme for this new datastream to co-exist with old-style event log indices.

@pmuellr pmuellr force-pushed the event-log/use-datastreams-2 branch from 92f264e to 9b372df Compare May 4, 2023 00:30
@pmuellr pmuellr force-pushed the event-log/use-datastreams-2 branch 3 times, most recently from 3da45d3 to c9191c3 Compare May 24, 2023 22:57
@pmuellr pmuellr force-pushed the event-log/use-datastreams-2 branch from c9191c3 to b6a1b80 Compare May 25, 2023 14:12
@pmuellr pmuellr added v8.9.0 ci:cloud-deploy Create or update a Cloud deployment labels May 25, 2023
@pmuellr pmuellr marked this pull request as ready for review May 25, 2023 17:17
@ymao1
Copy link
Contributor

ymao1 commented Jun 5, 2023

@pmuellr In the issue description for changing .alerts to datastream, it says

Serverless Elasticsearch will be replacing index lifecycle management with datastream lifecycle management, and we will no longer be allowed to create the .alerts-ilm-policy

Does this also apply to the event log? I see we are still manually creating an ILM policy for the event log

@pmuellr
Copy link
Member Author

pmuellr commented Jun 5, 2023

Does this also apply to the event log? I see we are still manually creating an ILM policy for the event log

Yes, it does, but we'll need it for other-than-serverless. My understanding is the data stream lifecycle management isn't quite done yet. Once it is, then I think the next task would be to customize startup for severless to do whatever we need to do for the ILM-replacement thing. Does that sound right @kobelb ?

@kobelb
Copy link
Contributor

kobelb commented Jun 5, 2023

Yes, it does, but we'll need it for other-than-serverless. My understanding is the data stream lifecycle management isn't quite done yet. Once it is, then I think the next task would be to customize startup for severless to do whatever we need to do for the ILM-replacement thing. Does that sound right @kobelb ?

Yup!

Copy link
Contributor

@ymao1 ymao1 left a comment

Choose a reason for hiding this comment

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

LGTM! Verified that a datastream is created for 8.9 and that the exec log could read from both the data stream and pre-8.9 event log indices.

@pmuellr
Copy link
Member Author

pmuellr commented Jun 6, 2023

@elasticmachine merge upstream

@pmuellr
Copy link
Member Author

pmuellr commented Jun 6, 2023

@elasticmachine merge upstream

@kibana-ci
Copy link
Collaborator

kibana-ci commented Jun 6, 2023

💚 Build Succeeded

Metrics [docs]

Unknown metric groups

ESLint disabled line counts

id before after diff
enterpriseSearch 19 21 +2
securitySolution 413 417 +4
total +6

Total ESLint disabled count

id before after diff
enterpriseSearch 20 22 +2
securitySolution 497 501 +4
total +6

History

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

cc @pmuellr

Copy link
Member

@spong spong left a comment

Choose a reason for hiding this comment

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

Security Solution integration test update LGTM! Thank you for this event-log upgrade @pmuellr!

@pmuellr pmuellr merged commit 001e816 into elastic:main Jun 7, 2023
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 ci:cloud-deploy Create or update a Cloud deployment Feature:EventLog 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.9.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Alerting] event log should work with data streams
8 participants