Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[8.12] [Discover][Alerts] Fix Discover results when alert excludes ma…
…tches from previous runs (elastic#176690) (elastic#176931) # Backport This will backport the following commits from `main` to `8.12`: - [[Discover][Alerts] Fix Discover results when alert excludes matches from previous runs (elastic#176690)](elastic#176690) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Julia Rechkunova","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-02-14T16:44:40Z","message":"[Discover][Alerts] Fix Discover results when alert excludes matches from previous runs (elastic#176690)\n\n- Closes https://github.com/elastic/kibana/issues/148282\r\n\r\n## Summary\r\n\r\nIn case if user creates a rule and enables \"Exclude matches from\r\nprevious runs\", Discover link will now include a time filter to filter\r\nprevious results out.\r\n\r\n<img width=\"500\" alt=\"Screenshot 2024-02-12 at 14 02 18\"\r\nsrc=\"https://github.com/elastic/kibana/assets/1415710/89ae9bb1-5fe7-4366-a3db-6ed3b8ae7545\">\r\n\r\nFor testing:\r\n- Open Discover with an index which has documents before and after\r\ncurrent time (e.g. a freshly installed Kibana Sample Data Logs)\r\n- Create a new rule \r\n - Enable/disable \"Exclude matches from previous runs\" switch\r\n - Define an index connector with a link\r\n```\r\n {\r\n \"rule_id\": \"\",\r\n \"rule_name\": \"\",\r\n \"alert_id\": \"\",\r\n \"context_message\": \"\",\r\n \"link\": \"\"\r\n}\r\n```\r\n- Now navigate to Discover, create a data view for the connector index\r\n- Copy locator links from the appearing alerts and open Discover with\r\nthem in another tab\r\n\r\n<img width=\"300\" alt=\"Screenshot 2024-02-12 at 15 19 24\"\r\nsrc=\"https://github.com/elastic/kibana/assets/1415710/0e5c3718-b16a-4360-a213-490479f85088\">\r\n\r\n\r\nIf \"Exclude matches from previous runs\" was enabled, then an additional\r\nfilter will show up on Discover page for the locator link.\r\n\r\nCheck that Discover total count is the same as the one mentioned in\r\n`context_message` field.","sha":"7e3a9f8fbe7c5513e4a4b74939593779d9ba4b24","branchLabelMapping":{"^v8.13.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","Feature:Alerting","Team:DataDiscovery","backport:prev-minor","v8.13.0"],"title":"[Discover][Alerts] Fix Discover results when alert excludes matches from previous runs","number":176690,"url":"https://github.com/elastic/kibana/pull/176690","mergeCommit":{"message":"[Discover][Alerts] Fix Discover results when alert excludes matches from previous runs (elastic#176690)\n\n- Closes https://github.com/elastic/kibana/issues/148282\r\n\r\n## Summary\r\n\r\nIn case if user creates a rule and enables \"Exclude matches from\r\nprevious runs\", Discover link will now include a time filter to filter\r\nprevious results out.\r\n\r\n<img width=\"500\" alt=\"Screenshot 2024-02-12 at 14 02 18\"\r\nsrc=\"https://github.com/elastic/kibana/assets/1415710/89ae9bb1-5fe7-4366-a3db-6ed3b8ae7545\">\r\n\r\nFor testing:\r\n- Open Discover with an index which has documents before and after\r\ncurrent time (e.g. a freshly installed Kibana Sample Data Logs)\r\n- Create a new rule \r\n - Enable/disable \"Exclude matches from previous runs\" switch\r\n - Define an index connector with a link\r\n```\r\n {\r\n \"rule_id\": \"\",\r\n \"rule_name\": \"\",\r\n \"alert_id\": \"\",\r\n \"context_message\": \"\",\r\n \"link\": \"\"\r\n}\r\n```\r\n- Now navigate to Discover, create a data view for the connector index\r\n- Copy locator links from the appearing alerts and open Discover with\r\nthem in another tab\r\n\r\n<img width=\"300\" alt=\"Screenshot 2024-02-12 at 15 19 24\"\r\nsrc=\"https://github.com/elastic/kibana/assets/1415710/0e5c3718-b16a-4360-a213-490479f85088\">\r\n\r\n\r\nIf \"Exclude matches from previous runs\" was enabled, then an additional\r\nfilter will show up on Discover page for the locator link.\r\n\r\nCheck that Discover total count is the same as the one mentioned in\r\n`context_message` field.","sha":"7e3a9f8fbe7c5513e4a4b74939593779d9ba4b24"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v8.13.0","branchLabelMappingKey":"^v8.13.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/176690","number":176690,"mergeCommit":{"message":"[Discover][Alerts] Fix Discover results when alert excludes matches from previous runs (elastic#176690)\n\n- Closes https://github.com/elastic/kibana/issues/148282\r\n\r\n## Summary\r\n\r\nIn case if user creates a rule and enables \"Exclude matches from\r\nprevious runs\", Discover link will now include a time filter to filter\r\nprevious results out.\r\n\r\n<img width=\"500\" alt=\"Screenshot 2024-02-12 at 14 02 18\"\r\nsrc=\"https://github.com/elastic/kibana/assets/1415710/89ae9bb1-5fe7-4366-a3db-6ed3b8ae7545\">\r\n\r\nFor testing:\r\n- Open Discover with an index which has documents before and after\r\ncurrent time (e.g. a freshly installed Kibana Sample Data Logs)\r\n- Create a new rule \r\n - Enable/disable \"Exclude matches from previous runs\" switch\r\n - Define an index connector with a link\r\n```\r\n {\r\n \"rule_id\": \"\",\r\n \"rule_name\": \"\",\r\n \"alert_id\": \"\",\r\n \"context_message\": \"\",\r\n \"link\": \"\"\r\n}\r\n```\r\n- Now navigate to Discover, create a data view for the connector index\r\n- Copy locator links from the appearing alerts and open Discover with\r\nthem in another tab\r\n\r\n<img width=\"300\" alt=\"Screenshot 2024-02-12 at 15 19 24\"\r\nsrc=\"https://github.com/elastic/kibana/assets/1415710/0e5c3718-b16a-4360-a213-490479f85088\">\r\n\r\n\r\nIf \"Exclude matches from previous runs\" was enabled, then an additional\r\nfilter will show up on Discover page for the locator link.\r\n\r\nCheck that Discover total count is the same as the one mentioned in\r\n`context_message` field.","sha":"7e3a9f8fbe7c5513e4a4b74939593779d9ba4b24"}}]}] BACKPORT--> Co-authored-by: Julia Rechkunova <[email protected]>
- Loading branch information