-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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] Add pagination and sorting to the alerts search strategy #126813
[ResponseOps] Add pagination and sorting to the alerts search strategy #126813
Conversation
Pinging @elastic/response-ops (Team:ResponseOps) |
…rategy_pagination_sorting
…rategy_pagination_sorting
pageSize: number; | ||
} | ||
|
||
export interface RuleRegistrySearchRequestSort { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should just use the estypes.Sort
type from import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey';
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!
}, | ||
}; | ||
}) | ||
: {}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
super small nitpick: should we try to be consistent with the types? (array)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
…rategy_pagination_sorting
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM just a question about the tests.
Not sure if it makes sense to also test for paginating from index 0? Probably fine without it, but it might make the API clearer to indicate in the test files that it can start at 0.
x-pack/plugins/rule_registry/server/search_strategy/search_strategy.test.ts
Outdated
Show resolved
Hide resolved
💚 Build SucceededMetrics [docs]Public APIs missing exports
History
To update your PR or re-run it, just comment with: |
…move-pdf-generation-to-screenshotting * 'main' of github.com:elastic/kibana: (62 commits) [Lens] Drop partial buckets option (elastic#127153) chore(NA): remove unused translation xpack.ml.management.jobsSpacesList.objectNoun from fr-FR (elastic#127457) Add data to user details page (elastic#127019) [Fleet] Make upload and registry package info consistent (elastic#126915) [Reporting] Capture browser errors (elastic#127135) Initial readme commit with some stub articles (elastic#127420) skip flaky suite (elastic#121482) skip flaky suite (elastic#127416) Tests to ensure Kibana is handling multi-space import of saved objects correctly (elastic#127229) [Aggs] remove toAngularJson (elastic#127267) [i18n] Integrate 8.2.0 Translations (elastic#127309) [Security Solution] [Endpoint] Creates generic policy tab artifact component to be used for all of our artifacts (elastic#126685) [Kibana React] Fix Page Template `solutionNav` propagation (elastic#127140) [Cases] Export getRelatedCases API from cases client (elastic#127065) [Cloud Posture]add support for sorting benchmark page (elastic#126983) [User experience] Fix filters for the app (elastic#127295) [Fleet] Fix timeserie dimension mapping (elastic#127328) [data view mgmt] fix data view name wrap (elastic#127319) [kbn/optimizer] extract string diffing logic (elastic#127394) [ResponseOps] Add pagination and sorting to the alerts search strategy (elastic#126813) ... # Conflicts: # x-pack/plugins/screenshotting/common/errors.ts # x-pack/plugins/screenshotting/common/index.ts # x-pack/plugins/screenshotting/server/screenshots/observable.ts
Friendly reminder: Looks like this PR hasn’t been backported yet. |
Friendly reminder: Looks like this PR hasn’t been backported yet. |
2 similar comments
Friendly reminder: Looks like this PR hasn’t been backported yet. |
Friendly reminder: Looks like this PR hasn’t been backported yet. |
Friendly reminder: Looks like this PR hasn’t been backported yet. |
8 similar comments
Friendly reminder: Looks like this PR hasn’t been backported yet. |
Friendly reminder: Looks like this PR hasn’t been backported yet. |
Friendly reminder: Looks like this PR hasn’t been backported yet. |
Friendly reminder: Looks like this PR hasn’t been backported yet. |
Friendly reminder: Looks like this PR hasn’t been backported yet. |
Friendly reminder: Looks like this PR hasn’t been backported yet. |
Friendly reminder: Looks like this PR hasn’t been backported yet. |
Friendly reminder: Looks like this PR hasn’t been backported yet. |
Resolves #126722
This PR adds the ability to sort and paginate the recently introduced search strategy.
Testing
I've been testing this by using Filebeat) and configure it to start ingesting the Elasticsearch server log:
Start Filebeat and visit the Logs UI to ensure the data is coming in.
Then, go to the rules for security solutions:
and create a custom rule that looks like:
Let the rule run for a few seconds and verify alerts are showing up:
Then, use curl or some tool to send a POST request to Kibana like:
Using this setup, you should be able to verify the functionality is working as intended.