Skip to content

WIP: Abstracting shared search strategy logic to common functions#6

Draft
rylnd wants to merge 1 commit intoeql_search_strategy_reduxfrom
eql_validation_final
Draft

WIP: Abstracting shared search strategy logic to common functions#6
rylnd wants to merge 1 commit intoeql_search_strategy_reduxfrom
eql_validation_final

Conversation

@rylnd
Copy link
Copy Markdown
Owner

@rylnd rylnd commented Oct 4, 2020

Summary

This is the combination of a few branches of work but demonstrates a first pass at consolidating some search strategy logic.

rylnd pushed a commit that referenced this pull request Sep 17, 2025
…de API (elastic#234571)

**Partially resolves: elastic#140369**

## Summary

This is another PR from of a series of PRs I am planning to create to
cover the requirements in the elastic#140369 ticket.

The requirement covered in this ticket is req. #6: "Events for
performing update (EBT backend)" and req. #7 "Missing base versions".

I am adding sending telemetry events in handling of rule update request.
Each rule updated will send its own event with information about:
- ruleId
- ruleName
- if missing base version
- final result of the update
- updated fields (with breakdown per conflict type). 

I tried to make the changes as little invasive as possible, and decided
to create a separate file, `update_rule_telemetry.ts`, where the logic
of building the events and sending them is encapsulated.

### Checklist

Check the PR satisfies following conditions. 

Reviewers should verify this PR satisfies this list as well.

- [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
- [x] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [x] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
- [ ] Review the [backport
guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)
and apply applicable `backport:*` labels.
rylnd pushed a commit that referenced this pull request Oct 17, 2025
…de API (elastic#234571)

**Partially resolves: elastic#140369**

## Summary

This is another PR from of a series of PRs I am planning to create to
cover the requirements in the elastic#140369 ticket.

The requirement covered in this ticket is req. #6: "Events for
performing update (EBT backend)" and req. #7 "Missing base versions".

I am adding sending telemetry events in handling of rule update request.
Each rule updated will send its own event with information about:
- ruleId
- ruleName
- if missing base version
- final result of the update
- updated fields (with breakdown per conflict type). 

I tried to make the changes as little invasive as possible, and decided
to create a separate file, `update_rule_telemetry.ts`, where the logic
of building the events and sending them is encapsulated.

### Checklist

Check the PR satisfies following conditions. 

Reviewers should verify this PR satisfies this list as well.

- [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
- [x] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [x] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
- [ ] Review the [backport
guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)
and apply applicable `backport:*` labels.
rylnd pushed a commit that referenced this pull request Oct 31, 2025
…e upgrade API (elastic#234571) (elastic#235318)

# Backport

This will backport the following commits from `main` to `8.19`:
- [[Security Solution] Add event-based telemetry for prebuilt rule
upgrade API (elastic#234571)](elastic#234571)

<!--- Backport version: 10.0.2 -->

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

<!--BACKPORT [{"author":{"name":"Jacek
Kolezynski","email":"jacek.kolezynski@elastic.co"},"sourceCommit":{"committedDate":"2025-09-17T07:45:06Z","message":"[Security
Solution] Add event-based telemetry for prebuilt rule upgrade API
(elastic#234571)\n\n**Partially resolves: elastic#140369**\n\n## Summary\n\nThis is
another PR from of a series of PRs I am planning to create to\ncover the
requirements in the elastic#140369 ticket.\n\nThe requirement covered in this
ticket is req. #6: \"Events for\nperforming update (EBT backend)\" and
req. #7 \"Missing base versions\".\n\nI am adding sending telemetry
events in handling of rule update request.\nEach rule updated will send
its own event with information about:\n- ruleId\n- ruleName\n- if
missing base version\n- final result of the update\n- updated fields
(with breakdown per conflict type). \n\nI tried to make the changes as
little invasive as possible, and decided\nto create a separate file,
`update_rule_telemetry.ts`, where the logic\nof building the events and
sending them is encapsulated.\n\n### Checklist\n\nCheck the PR satisfies
following conditions. \n\nReviewers should verify this PR satisfies this
list as well.\n\n- [x] [Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common scenarios\n- [x] [Flaky
Test\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\nused on any tests changed\n- [x] The PR description includes the
appropriate Release Notes section,\nand the correct `release_note:*`
label is applied per
the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n-
[ ] Review the
[backport\nguidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)\nand
apply applicable `backport:*`
labels.","sha":"a2b7329e26fe9031d387138cf0f019aa4c53cd93","branchLabelMapping":{"^v9.2.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:Detections
and Resp","Team: SecuritySolution","Team:Detection Rule
Management","Feature:Prebuilt Detection
Rules","backport:version","v9.2.0","v8.18.8","v8.19.5","v9.0.8","v9.1.5"],"title":"[Security
Solution] Add event-based telemetry for prebuilt rule upgrade
API","number":234571,"url":"https://github.com/elastic/kibana/pull/234571","mergeCommit":{"message":"[Security
Solution] Add event-based telemetry for prebuilt rule upgrade API
(elastic#234571)\n\n**Partially resolves: elastic#140369**\n\n## Summary\n\nThis is
another PR from of a series of PRs I am planning to create to\ncover the
requirements in the elastic#140369 ticket.\n\nThe requirement covered in this
ticket is req. #6: \"Events for\nperforming update (EBT backend)\" and
req. #7 \"Missing base versions\".\n\nI am adding sending telemetry
events in handling of rule update request.\nEach rule updated will send
its own event with information about:\n- ruleId\n- ruleName\n- if
missing base version\n- final result of the update\n- updated fields
(with breakdown per conflict type). \n\nI tried to make the changes as
little invasive as possible, and decided\nto create a separate file,
`update_rule_telemetry.ts`, where the logic\nof building the events and
sending them is encapsulated.\n\n### Checklist\n\nCheck the PR satisfies
following conditions. \n\nReviewers should verify this PR satisfies this
list as well.\n\n- [x] [Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common scenarios\n- [x] [Flaky
Test\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\nused on any tests changed\n- [x] The PR description includes the
appropriate Release Notes section,\nand the correct `release_note:*`
label is applied per
the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n-
[ ] Review the
[backport\nguidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)\nand
apply applicable `backport:*`
labels.","sha":"a2b7329e26fe9031d387138cf0f019aa4c53cd93"}},"sourceBranch":"main","suggestedTargetBranches":["8.18","8.19","9.0","9.1"],"targetPullRequestStates":[{"branch":"main","label":"v9.2.0","branchLabelMappingKey":"^v9.2.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/234571","number":234571,"mergeCommit":{"message":"[Security
Solution] Add event-based telemetry for prebuilt rule upgrade API
(elastic#234571)\n\n**Partially resolves: elastic#140369**\n\n## Summary\n\nThis is
another PR from of a series of PRs I am planning to create to\ncover the
requirements in the elastic#140369 ticket.\n\nThe requirement covered in this
ticket is req. #6: \"Events for\nperforming update (EBT backend)\" and
req. #7 \"Missing base versions\".\n\nI am adding sending telemetry
events in handling of rule update request.\nEach rule updated will send
its own event with information about:\n- ruleId\n- ruleName\n- if
missing base version\n- final result of the update\n- updated fields
(with breakdown per conflict type). \n\nI tried to make the changes as
little invasive as possible, and decided\nto create a separate file,
`update_rule_telemetry.ts`, where the logic\nof building the events and
sending them is encapsulated.\n\n### Checklist\n\nCheck the PR satisfies
following conditions. \n\nReviewers should verify this PR satisfies this
list as well.\n\n- [x] [Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common scenarios\n- [x] [Flaky
Test\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\nused on any tests changed\n- [x] The PR description includes the
appropriate Release Notes section,\nand the correct `release_note:*`
label is applied per
the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n-
[ ] Review the
[backport\nguidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)\nand
apply applicable `backport:*`
labels.","sha":"a2b7329e26fe9031d387138cf0f019aa4c53cd93"}},{"branch":"8.18","label":"v8.18.8","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.19","label":"v8.19.5","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"9.0","label":"v9.0.8","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"}]}]
BACKPORT-->
rylnd pushed a commit that referenced this pull request Nov 14, 2025
… upgrade API (elastic#234571) (elastic#235315)

# Backport

This will backport the following commits from `main` to `9.1`:
- [[Security Solution] Add event-based telemetry for prebuilt rule
upgrade API (elastic#234571)](elastic#234571)

<!--- Backport version: 10.0.2 -->

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

<!--BACKPORT [{"author":{"name":"Jacek
Kolezynski","email":"jacek.kolezynski@elastic.co"},"sourceCommit":{"committedDate":"2025-09-17T07:45:06Z","message":"[Security
Solution] Add event-based telemetry for prebuilt rule upgrade API
(elastic#234571)\n\n**Partially resolves: elastic#140369**\n\n## Summary\n\nThis is
another PR from of a series of PRs I am planning to create to\ncover the
requirements in the elastic#140369 ticket.\n\nThe requirement covered in this
ticket is req. #6: \"Events for\nperforming update (EBT backend)\" and
req. #7 \"Missing base versions\".\n\nI am adding sending telemetry
events in handling of rule update request.\nEach rule updated will send
its own event with information about:\n- ruleId\n- ruleName\n- if
missing base version\n- final result of the update\n- updated fields
(with breakdown per conflict type). \n\nI tried to make the changes as
little invasive as possible, and decided\nto create a separate file,
`update_rule_telemetry.ts`, where the logic\nof building the events and
sending them is encapsulated.\n\n### Checklist\n\nCheck the PR satisfies
following conditions. \n\nReviewers should verify this PR satisfies this
list as well.\n\n- [x] [Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common scenarios\n- [x] [Flaky
Test\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\nused on any tests changed\n- [x] The PR description includes the
appropriate Release Notes section,\nand the correct `release_note:*`
label is applied per
the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n-
[ ] Review the
[backport\nguidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)\nand
apply applicable `backport:*`
labels.","sha":"a2b7329e26fe9031d387138cf0f019aa4c53cd93","branchLabelMapping":{"^v9.2.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:Detections
and Resp","Team: SecuritySolution","Team:Detection Rule
Management","Feature:Prebuilt Detection
Rules","backport:version","v9.2.0","v8.18.8","v8.19.5","v9.0.8","v9.1.5"],"title":"[Security
Solution] Add event-based telemetry for prebuilt rule upgrade
API","number":234571,"url":"https://github.com/elastic/kibana/pull/234571","mergeCommit":{"message":"[Security
Solution] Add event-based telemetry for prebuilt rule upgrade API
(elastic#234571)\n\n**Partially resolves: elastic#140369**\n\n## Summary\n\nThis is
another PR from of a series of PRs I am planning to create to\ncover the
requirements in the elastic#140369 ticket.\n\nThe requirement covered in this
ticket is req. #6: \"Events for\nperforming update (EBT backend)\" and
req. #7 \"Missing base versions\".\n\nI am adding sending telemetry
events in handling of rule update request.\nEach rule updated will send
its own event with information about:\n- ruleId\n- ruleName\n- if
missing base version\n- final result of the update\n- updated fields
(with breakdown per conflict type). \n\nI tried to make the changes as
little invasive as possible, and decided\nto create a separate file,
`update_rule_telemetry.ts`, where the logic\nof building the events and
sending them is encapsulated.\n\n### Checklist\n\nCheck the PR satisfies
following conditions. \n\nReviewers should verify this PR satisfies this
list as well.\n\n- [x] [Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common scenarios\n- [x] [Flaky
Test\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\nused on any tests changed\n- [x] The PR description includes the
appropriate Release Notes section,\nand the correct `release_note:*`
label is applied per
the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n-
[ ] Review the
[backport\nguidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)\nand
apply applicable `backport:*`
labels.","sha":"a2b7329e26fe9031d387138cf0f019aa4c53cd93"}},"sourceBranch":"main","suggestedTargetBranches":["8.18","8.19","9.0","9.1"],"targetPullRequestStates":[{"branch":"main","label":"v9.2.0","branchLabelMappingKey":"^v9.2.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/234571","number":234571,"mergeCommit":{"message":"[Security
Solution] Add event-based telemetry for prebuilt rule upgrade API
(elastic#234571)\n\n**Partially resolves: elastic#140369**\n\n## Summary\n\nThis is
another PR from of a series of PRs I am planning to create to\ncover the
requirements in the elastic#140369 ticket.\n\nThe requirement covered in this
ticket is req. #6: \"Events for\nperforming update (EBT backend)\" and
req. #7 \"Missing base versions\".\n\nI am adding sending telemetry
events in handling of rule update request.\nEach rule updated will send
its own event with information about:\n- ruleId\n- ruleName\n- if
missing base version\n- final result of the update\n- updated fields
(with breakdown per conflict type). \n\nI tried to make the changes as
little invasive as possible, and decided\nto create a separate file,
`update_rule_telemetry.ts`, where the logic\nof building the events and
sending them is encapsulated.\n\n### Checklist\n\nCheck the PR satisfies
following conditions. \n\nReviewers should verify this PR satisfies this
list as well.\n\n- [x] [Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common scenarios\n- [x] [Flaky
Test\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\nused on any tests changed\n- [x] The PR description includes the
appropriate Release Notes section,\nand the correct `release_note:*`
label is applied per
the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n-
[ ] Review the
[backport\nguidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)\nand
apply applicable `backport:*`
labels.","sha":"a2b7329e26fe9031d387138cf0f019aa4c53cd93"}},{"branch":"8.18","label":"v8.18.8","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.19","label":"v8.19.5","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"9.0","label":"v9.0.8","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"}]}]
BACKPORT-->
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.

1 participant