Skip to content

Comments

[Security Solution][Detection Engine] Split search request building from search#216887

Merged
marshallmain merged 10 commits intoelastic:mainfrom
marshallmain:de-searchafter-split
Apr 15, 2025
Merged

[Security Solution][Detection Engine] Split search request building from search#216887
marshallmain merged 10 commits intoelastic:mainfrom
marshallmain:de-searchafter-split

Conversation

@marshallmain
Copy link
Contributor

@marshallmain marshallmain commented Apr 2, 2025

Summary

This PR better separates the request building logic in the detection engine from query building logic, removes outdated error checking logic, updates the singleSearchAfter search call to no longer use the legacy meta: true param, and improves search response type inference.

@marshallmain marshallmain added release_note:skip Skip the PR/issue when compiling release notes Team:Detection Engine Security Solution Detection Engine Area backport:version Backport to applied version labels v9.1.0 v8.19.0 labels Apr 2, 2025
@marshallmain marshallmain requested a review from a team as a code owner April 2, 2025 16:27
@marshallmain marshallmain requested a review from vitaliidm April 2, 2025 16:27
@elasticmachine
Copy link
Contributor

Pinging @elastic/security-detection-engine (Team:Detection Engine)

@marshallmain marshallmain marked this pull request as draft April 2, 2025 19:48
@marshallmain marshallmain marked this pull request as ready for review April 7, 2025 04:23
@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Unknown metric groups

ESLint disabled line counts

id before after diff
securitySolution 575 574 -1

Total ESLint disabled count

id before after diff
securitySolution 658 657 -1

History

@marshallmain marshallmain merged commit dee4dfb into elastic:main Apr 15, 2025
9 checks passed
@marshallmain marshallmain deleted the de-searchafter-split branch April 15, 2025 12:19
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.x

https://github.com/elastic/kibana/actions/runs/14469229860

@kibanamachine
Copy link
Contributor

💔 All backports failed

Status Branch Result
8.x Backport failed because of merge conflicts

Manual backport

To create the backport manually run:

node scripts/backport --pr 216887

Questions ?

Please refer to the Backport tool documentation

@marshallmain
Copy link
Contributor Author

💚 All backports created successfully

Status Branch Result
8.x

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

marshallmain added a commit that referenced this pull request Apr 16, 2025
…ding from search (#216887) (#218262)

# Backport

This will backport the following commits from `main` to `8.x`:
- [[Security Solution][Detection Engine] Split search request building
from search (#216887)](#216887)

<!--- Backport version: 9.6.6 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Marshall
Main","email":"55718608+marshallmain@users.noreply.github.com"},"sourceCommit":{"committedDate":"2025-04-15T12:19:34Z","message":"[Security
Solution][Detection Engine] Split search request building from search
(#216887)\n\n## Summary\n\nThis PR better separates the request building
logic in the detection\nengine from query building logic, removes
outdated error checking logic,\nupdates the `singleSearchAfter` `search`
call to no longer use the\nlegacy `meta: true` param, and improves
search response type
inference.","sha":"dee4dfbe5995614b82792b692775c150dc79635e","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:Detection
Engine","backport:version","v9.1.0","v8.19.0"],"title":"[Security
Solution][Detection Engine] Split search request building from
search","number":216887,"url":"https://github.com/elastic/kibana/pull/216887","mergeCommit":{"message":"[Security
Solution][Detection Engine] Split search request building from search
(#216887)\n\n## Summary\n\nThis PR better separates the request building
logic in the detection\nengine from query building logic, removes
outdated error checking logic,\nupdates the `singleSearchAfter` `search`
call to no longer use the\nlegacy `meta: true` param, and improves
search response type
inference.","sha":"dee4dfbe5995614b82792b692775c150dc79635e"}},"sourceBranch":"main","suggestedTargetBranches":["8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/216887","number":216887,"mergeCommit":{"message":"[Security
Solution][Detection Engine] Split search request building from search
(#216887)\n\n## Summary\n\nThis PR better separates the request building
logic in the detection\nengine from query building logic, removes
outdated error checking logic,\nupdates the `singleSearchAfter` `search`
call to no longer use the\nlegacy `meta: true` param, and improves
search response type
inference.","sha":"dee4dfbe5995614b82792b692775c150dc79635e"}},{"branch":"8.x","label":"v8.19.0","branchLabelMappingKey":"^v8.19.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->
marshallmain added a commit that referenced this pull request Oct 29, 2025
…o group by fields defined (#241022)

Fixes a regression in threshold rule logic introduced by
#216887 - threshold rules with no
"group by" fields defined would no longer generate alerts.
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Oct 29, 2025
…o group by fields defined (elastic#241022)

Fixes a regression in threshold rule logic introduced by
elastic#216887 - threshold rules with no
"group by" fields defined would no longer generate alerts.

(cherry picked from commit fce9007)
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Oct 29, 2025
…o group by fields defined (elastic#241022)

Fixes a regression in threshold rule logic introduced by
elastic#216887 - threshold rules with no
"group by" fields defined would no longer generate alerts.

(cherry picked from commit fce9007)
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Oct 29, 2025
…o group by fields defined (elastic#241022)

Fixes a regression in threshold rule logic introduced by
elastic#216887 - threshold rules with no
"group by" fields defined would no longer generate alerts.

(cherry picked from commit fce9007)
tkajtoch pushed a commit to tkajtoch/kibana that referenced this pull request Oct 29, 2025
…o group by fields defined (elastic#241022)

Fixes a regression in threshold rule logic introduced by
elastic#216887 - threshold rules with no
"group by" fields defined would no longer generate alerts.
kibanamachine added a commit that referenced this pull request Oct 29, 2025
…with no group by fields defined (#241022) (#241123)

# Backport

This will backport the following commits from `main` to `9.1`:
- [[Security Solution][Detection Engine] Fix threshold rule logic with
no group by fields defined
(#241022)](#241022)

<!--- Backport version: 9.6.6 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Marshall
Main","email":"55718608+marshallmain@users.noreply.github.com"},"sourceCommit":{"committedDate":"2025-10-29T12:18:27Z","message":"[Security
Solution][Detection Engine] Fix threshold rule logic with no group by
fields defined (#241022)\n\nFixes a regression in threshold rule logic
introduced by\nhttps://github.com//pull/216887 - threshold
rules with no\n\"group by\" fields defined would no longer generate
alerts.","sha":"fce90071cc1be29b9874d8dc147e6ea0ca8a513b","branchLabelMapping":{"^v9.3.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","Team:
SecuritySolution","Team:Detection
Engine","backport:version","v8.19.5","v9.1.5","v9.3.0","v9.2.1"],"title":"[Security
Solution][Detection Engine] Fix threshold rule logic with no group by
fields
defined","number":241022,"url":"https://github.com/elastic/kibana/pull/241022","mergeCommit":{"message":"[Security
Solution][Detection Engine] Fix threshold rule logic with no group by
fields defined (#241022)\n\nFixes a regression in threshold rule logic
introduced by\nhttps://github.com//pull/216887 - threshold
rules with no\n\"group by\" fields defined would no longer generate
alerts.","sha":"fce90071cc1be29b9874d8dc147e6ea0ca8a513b"}},"sourceBranch":"main","suggestedTargetBranches":["8.19","9.1","9.2"],"targetPullRequestStates":[{"branch":"8.19","label":"v8.19.5","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"9.1","label":"v9.1.5","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.3.0","branchLabelMappingKey":"^v9.3.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/241022","number":241022,"mergeCommit":{"message":"[Security
Solution][Detection Engine] Fix threshold rule logic with no group by
fields defined (#241022)\n\nFixes a regression in threshold rule logic
introduced by\nhttps://github.com//pull/216887 - threshold
rules with no\n\"group by\" fields defined would no longer generate
alerts.","sha":"fce90071cc1be29b9874d8dc147e6ea0ca8a513b"}},{"branch":"9.2","label":"v9.2.1","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Marshall Main <55718608+marshallmain@users.noreply.github.com>
kibanamachine added a commit that referenced this pull request Oct 29, 2025
… with no group by fields defined (#241022) (#241122)

# Backport

This will backport the following commits from `main` to `8.19`:
- [[Security Solution][Detection Engine] Fix threshold rule logic with
no group by fields defined
(#241022)](#241022)

<!--- Backport version: 9.6.6 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Marshall
Main","email":"55718608+marshallmain@users.noreply.github.com"},"sourceCommit":{"committedDate":"2025-10-29T12:18:27Z","message":"[Security
Solution][Detection Engine] Fix threshold rule logic with no group by
fields defined (#241022)\n\nFixes a regression in threshold rule logic
introduced by\nhttps://github.com//pull/216887 - threshold
rules with no\n\"group by\" fields defined would no longer generate
alerts.","sha":"fce90071cc1be29b9874d8dc147e6ea0ca8a513b","branchLabelMapping":{"^v9.3.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","Team:
SecuritySolution","Team:Detection
Engine","backport:version","v8.19.5","v9.1.5","v9.3.0","v9.2.1"],"title":"[Security
Solution][Detection Engine] Fix threshold rule logic with no group by
fields
defined","number":241022,"url":"https://github.com/elastic/kibana/pull/241022","mergeCommit":{"message":"[Security
Solution][Detection Engine] Fix threshold rule logic with no group by
fields defined (#241022)\n\nFixes a regression in threshold rule logic
introduced by\nhttps://github.com//pull/216887 - threshold
rules with no\n\"group by\" fields defined would no longer generate
alerts.","sha":"fce90071cc1be29b9874d8dc147e6ea0ca8a513b"}},"sourceBranch":"main","suggestedTargetBranches":["8.19","9.1","9.2"],"targetPullRequestStates":[{"branch":"8.19","label":"v8.19.5","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"9.1","label":"v9.1.5","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.3.0","branchLabelMappingKey":"^v9.3.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/241022","number":241022,"mergeCommit":{"message":"[Security
Solution][Detection Engine] Fix threshold rule logic with no group by
fields defined (#241022)\n\nFixes a regression in threshold rule logic
introduced by\nhttps://github.com//pull/216887 - threshold
rules with no\n\"group by\" fields defined would no longer generate
alerts.","sha":"fce90071cc1be29b9874d8dc147e6ea0ca8a513b"}},{"branch":"9.2","label":"v9.2.1","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Marshall Main <55718608+marshallmain@users.noreply.github.com>
kibanamachine added a commit that referenced this pull request Oct 29, 2025
…with no group by fields defined (#241022) (#241125)

# Backport

This will backport the following commits from `main` to `9.2`:
- [[Security Solution][Detection Engine] Fix threshold rule logic with
no group by fields defined
(#241022)](#241022)

<!--- Backport version: 9.6.6 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Marshall
Main","email":"55718608+marshallmain@users.noreply.github.com"},"sourceCommit":{"committedDate":"2025-10-29T12:18:27Z","message":"[Security
Solution][Detection Engine] Fix threshold rule logic with no group by
fields defined (#241022)\n\nFixes a regression in threshold rule logic
introduced by\nhttps://github.com//pull/216887 - threshold
rules with no\n\"group by\" fields defined would no longer generate
alerts.","sha":"fce90071cc1be29b9874d8dc147e6ea0ca8a513b","branchLabelMapping":{"^v9.3.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","Team:
SecuritySolution","Team:Detection
Engine","backport:version","v8.19.5","v9.1.5","v9.3.0","v9.2.1"],"title":"[Security
Solution][Detection Engine] Fix threshold rule logic with no group by
fields
defined","number":241022,"url":"https://github.com/elastic/kibana/pull/241022","mergeCommit":{"message":"[Security
Solution][Detection Engine] Fix threshold rule logic with no group by
fields defined (#241022)\n\nFixes a regression in threshold rule logic
introduced by\nhttps://github.com//pull/216887 - threshold
rules with no\n\"group by\" fields defined would no longer generate
alerts.","sha":"fce90071cc1be29b9874d8dc147e6ea0ca8a513b"}},"sourceBranch":"main","suggestedTargetBranches":["8.19","9.1","9.2"],"targetPullRequestStates":[{"branch":"8.19","label":"v8.19.5","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"9.1","label":"v9.1.5","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.3.0","branchLabelMappingKey":"^v9.3.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/241022","number":241022,"mergeCommit":{"message":"[Security
Solution][Detection Engine] Fix threshold rule logic with no group by
fields defined (#241022)\n\nFixes a regression in threshold rule logic
introduced by\nhttps://github.com//pull/216887 - threshold
rules with no\n\"group by\" fields defined would no longer generate
alerts.","sha":"fce90071cc1be29b9874d8dc147e6ea0ca8a513b"}},{"branch":"9.2","label":"v9.2.1","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Marshall Main <55718608+marshallmain@users.noreply.github.com>
qn895 pushed a commit to qn895/kibana that referenced this pull request Oct 30, 2025
…o group by fields defined (elastic#241022)

Fixes a regression in threshold rule logic introduced by
elastic#216887 - threshold rules with no
"group by" fields defined would no longer generate alerts.
ana-davydova pushed a commit to ana-davydova/kibana that referenced this pull request Nov 3, 2025
…o group by fields defined (elastic#241022)

Fixes a regression in threshold rule logic introduced by
elastic#216887 - threshold rules with no
"group by" fields defined would no longer generate alerts.
albertoblaz pushed a commit to albertoblaz/kibana that referenced this pull request Nov 4, 2025
…o group by fields defined (elastic#241022)

Fixes a regression in threshold rule logic introduced by
elastic#216887 - threshold rules with no
"group by" fields defined would no longer generate alerts.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:version Backport to applied version labels release_note:skip Skip the PR/issue when compiling release notes Team:Detection Engine Security Solution Detection Engine Area v8.19.0 v9.1.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants