Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[8.x] [Response Ops][Maintenance Window] Fix Maintenance Window Wildc…
…ard Scoped Queries (#194777) (#197928) # Backport This will backport the following commits from `main` to `8.x`: - [[Response Ops][Maintenance Window] Fix Maintenance Window Wildcard Scoped Queries (#194777)](#194777) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Jiawei Wu","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-10-26T09:47:29Z","message":"[Response Ops][Maintenance Window] Fix Maintenance Window Wildcard Scoped Queries (#194777)\n\n## Summary\r\n\r\nIssue: https://github.com/elastic/sdh-kibana/issues/4923\r\n\r\nFixes maintenance window scoped query using wildcards by injecting the\r\n`analyze_wildcard` property to the DSL used to determine which alerts\r\nshould be associated with the maintenance window.\r\n\r\nAlso fixes the update route to correctly take into account the user's\r\n`allowLeadingWildcard` flag. It was implemented for the create route but\r\nnot the update route.\r\n\r\nFixes: https://github.com/elastic/kibana/issues/194763\r\n\r\n### To test:\r\n1. Install sample data:\r\n\r\n![image](https://github.com/user-attachments/assets/4be72fc8-e4ab-47a3-b5db-48f97b1827ae)\r\n\r\n2. Create a maintenance window with the following scoped query: \r\n\r\n![image](https://github.com/user-attachments/assets/e2d37fd0-b957-4e76-bea3-8d954651c557)\r\n\r\n3. Create a ES query rule and trigger actions:\r\n\r\n![image](https://github.com/user-attachments/assets/551f5145-9ab7-48c4-a48e-e674b4f0509a)\r\n\r\n4. Assert the `maintenance_window_id` on the 4 alerts are set\r\n\r\n![image](https://github.com/user-attachments/assets/7ace95d3-d992-4305-a564-cf3004c9ae9e)\r\n\r\n\r\n### Checklist\r\n- [x] [Unit or functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere updated or added to match the most common scenarios)\r\n\r\n---------\r\n\r\nCo-authored-by: Elastic Machine <[email protected]>","sha":"7ad937db574603e53aeebe69d591554801cf857b","branchLabelMapping":{"^v9.0.0$":"main","^v8.17.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["bug","release_note:skip","Team:ResponseOps","v9.0.0","backport:prev-major","v8.16.0","v8.17.0"],"title":"[Response Ops][Maintenance Window] Fix Maintenance Window Wildcard Scoped Queries","number":194777,"url":"https://github.com/elastic/kibana/pull/194777","mergeCommit":{"message":"[Response Ops][Maintenance Window] Fix Maintenance Window Wildcard Scoped Queries (#194777)\n\n## Summary\r\n\r\nIssue: https://github.com/elastic/sdh-kibana/issues/4923\r\n\r\nFixes maintenance window scoped query using wildcards by injecting the\r\n`analyze_wildcard` property to the DSL used to determine which alerts\r\nshould be associated with the maintenance window.\r\n\r\nAlso fixes the update route to correctly take into account the user's\r\n`allowLeadingWildcard` flag. It was implemented for the create route but\r\nnot the update route.\r\n\r\nFixes: https://github.com/elastic/kibana/issues/194763\r\n\r\n### To test:\r\n1. Install sample data:\r\n\r\n![image](https://github.com/user-attachments/assets/4be72fc8-e4ab-47a3-b5db-48f97b1827ae)\r\n\r\n2. Create a maintenance window with the following scoped query: \r\n\r\n![image](https://github.com/user-attachments/assets/e2d37fd0-b957-4e76-bea3-8d954651c557)\r\n\r\n3. Create a ES query rule and trigger actions:\r\n\r\n![image](https://github.com/user-attachments/assets/551f5145-9ab7-48c4-a48e-e674b4f0509a)\r\n\r\n4. Assert the `maintenance_window_id` on the 4 alerts are set\r\n\r\n![image](https://github.com/user-attachments/assets/7ace95d3-d992-4305-a564-cf3004c9ae9e)\r\n\r\n\r\n### Checklist\r\n- [x] [Unit or functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere updated or added to match the most common scenarios)\r\n\r\n---------\r\n\r\nCo-authored-by: Elastic Machine <[email protected]>","sha":"7ad937db574603e53aeebe69d591554801cf857b"}},"sourceBranch":"main","suggestedTargetBranches":["8.16","8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/194777","number":194777,"mergeCommit":{"message":"[Response Ops][Maintenance Window] Fix Maintenance Window Wildcard Scoped Queries (#194777)\n\n## Summary\r\n\r\nIssue: https://github.com/elastic/sdh-kibana/issues/4923\r\n\r\nFixes maintenance window scoped query using wildcards by injecting the\r\n`analyze_wildcard` property to the DSL used to determine which alerts\r\nshould be associated with the maintenance window.\r\n\r\nAlso fixes the update route to correctly take into account the user's\r\n`allowLeadingWildcard` flag. It was implemented for the create route but\r\nnot the update route.\r\n\r\nFixes: https://github.com/elastic/kibana/issues/194763\r\n\r\n### To test:\r\n1. Install sample data:\r\n\r\n![image](https://github.com/user-attachments/assets/4be72fc8-e4ab-47a3-b5db-48f97b1827ae)\r\n\r\n2. Create a maintenance window with the following scoped query: \r\n\r\n![image](https://github.com/user-attachments/assets/e2d37fd0-b957-4e76-bea3-8d954651c557)\r\n\r\n3. Create a ES query rule and trigger actions:\r\n\r\n![image](https://github.com/user-attachments/assets/551f5145-9ab7-48c4-a48e-e674b4f0509a)\r\n\r\n4. Assert the `maintenance_window_id` on the 4 alerts are set\r\n\r\n![image](https://github.com/user-attachments/assets/7ace95d3-d992-4305-a564-cf3004c9ae9e)\r\n\r\n\r\n### Checklist\r\n- [x] [Unit or functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere updated or added to match the most common scenarios)\r\n\r\n---------\r\n\r\nCo-authored-by: Elastic Machine <[email protected]>","sha":"7ad937db574603e53aeebe69d591554801cf857b"}},{"branch":"8.16","label":"v8.16.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.x","label":"v8.17.0","branchLabelMappingKey":"^v8.17.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Jiawei Wu <[email protected]>
- Loading branch information