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

Alert generator improvements #13

Merged
merged 4 commits into from
Jun 12, 2024
Merged

Conversation

hop-dev
Copy link
Contributor

@hop-dev hop-dev commented Jun 7, 2024

Improve the speed and function of the generate-alerts command. New usage:

# yarn start generate-alerts -n <number of alerts> -h <number of hosts within the alerts> -u <number of users within the alerts>

yarn start generate-alerts -n 1000000 -h 10000 -u 10000

A few improvements:

  • batch up alerts for multiple entities in a single ES batch operation ⏩
  • run batch operations concurrently ⏩
  • Use faker host and usernames not Host-${i}
  • add arguments for number of hosts and users within alerts
  • Make a couple of config values optional which should haver been from the start 🐛

Example output with shiny new progress bar:

Screenshot 2024-06-07 at 10 17 01

we dont have typechecking and linting on PRs here, here is proof its good ;)

> yarn typecheck
yarn run v1.22.21
$ tsc --noEmit
✨  Done in 1.27s.
> yarn lint
yarn run v1.22.21
$ eslint ./src
✨  Done in 0.79s.

@hop-dev hop-dev requested a review from machadoum June 11, 2024 08:05
Copy link
Member

@machadoum machadoum left a comment

Choose a reason for hiding this comment

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

Great job! It is much faster 🚀 🚀 🚀

@hop-dev hop-dev merged commit ca5fd4e into elastic:main Jun 12, 2024
1 check passed
@hop-dev hop-dev deleted the alert-gen-improvements branch June 12, 2024 10:35
hop-dev added a commit to hop-dev/security-documents-generator that referenced this pull request Oct 29, 2024
* make config optional

* event index tidy

* improve alert generation

* update readme
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants