…ing (#219826) (#221476)
# Backport
This will backport the following commits from `main` to `8.19`:
- [[Custom threshold] Save group by information with dynamic mapping
(#219826)](#219826)
<!--- Backport version: 9.6.6 -->
### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)
<!--BACKPORT [{"author":{"name":"Maryam
Saeidi","email":"maryam.saeidi@elastic.co"},"sourceCommit":{"committedDate":"2025-05-24T13:17:43Z","message":"[Custom
threshold] Save group by information with dynamic mapping
(#219826)\n\nRelaetd to #183248
\nAuto-increasing mapping limit
PR:\nhttps://github.com//pull/216719\n\n## Summary\n\nIn
this PR, we are saving dynamically mapped group by information for\nthe
custom threshold rule. This consists of two parts:\n\n1. Adding a
dynamic field\n```\n// kibana.alert.grouping\n[ALERT_GROUPING]: {\n
type: 'object',\n dynamic: true,\n array: false,\n required: false,\n
},\n```\n2. Adding a dynamic template\n```\ndynamicTemplates: [\n {\n
strings_as_keywords: {\n path_match: 'kibana.alert.grouping.*',\n
match_mapping_type: 'string',\n mapping: {\n type: 'keyword',\n
ignore_above: 1024,\n },\n },\n },\n ],\n```\n\nThe result of adding
these mappings can be seen
below:\n|Alert|Mapping|\n|---|---|\n\n|||\n\nIf
the number of mapping limit is exceeded, the fields that are not\nmapped
are going to be added to the `_ignored` field, but the value
is\navailable in the
doc.\n\n<img\nsrc=\"https://github.com/user-attachments/assets/b84bcf03-b757-4f37-a93f-2559aefa5bcf\"\nwidth=500
/>","sha":"1ec32967f857f6e6e2b9f45f4da5751997254e4e","branchLabelMapping":{"^v9.1.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:feature","Team:obs-ux-management","backport:version","v9.1.0","v8.19.0","author:obs-ux-management"],"title":"[Custom
threshold] Save group by information with dynamic
mapping","number":219826,"url":"https://github.com/elastic/kibana/pull/219826","mergeCommit":{"message":"[Custom
threshold] Save group by information with dynamic mapping
(#219826)\n\nRelaetd to #183248
\nAuto-increasing mapping limit
PR:\nhttps://github.com//pull/216719\n\n## Summary\n\nIn
this PR, we are saving dynamically mapped group by information for\nthe
custom threshold rule. This consists of two parts:\n\n1. Adding a
dynamic field\n```\n// kibana.alert.grouping\n[ALERT_GROUPING]: {\n
type: 'object',\n dynamic: true,\n array: false,\n required: false,\n
},\n```\n2. Adding a dynamic template\n```\ndynamicTemplates: [\n {\n
strings_as_keywords: {\n path_match: 'kibana.alert.grouping.*',\n
match_mapping_type: 'string',\n mapping: {\n type: 'keyword',\n
ignore_above: 1024,\n },\n },\n },\n ],\n```\n\nThe result of adding
these mappings can be seen
below:\n|Alert|Mapping|\n|---|---|\n\n|||\n\nIf
the number of mapping limit is exceeded, the fields that are not\nmapped
are going to be added to the `_ignored` field, but the value
is\navailable in the
doc.\n\n<img\nsrc=\"https://github.com/user-attachments/assets/b84bcf03-b757-4f37-a93f-2559aefa5bcf\"\nwidth=500
/>","sha":"1ec32967f857f6e6e2b9f45f4da5751997254e4e"}},"sourceBranch":"main","suggestedTargetBranches":["8.19"],"targetPullRequestStates":[{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/219826","number":219826,"mergeCommit":{"message":"[Custom
threshold] Save group by information with dynamic mapping
(#219826)\n\nRelaetd to #183248
\nAuto-increasing mapping limit
PR:\nhttps://github.com//pull/216719\n\n## Summary\n\nIn
this PR, we are saving dynamically mapped group by information for\nthe
custom threshold rule. This consists of two parts:\n\n1. Adding a
dynamic field\n```\n// kibana.alert.grouping\n[ALERT_GROUPING]: {\n
type: 'object',\n dynamic: true,\n array: false,\n required: false,\n
},\n```\n2. Adding a dynamic template\n```\ndynamicTemplates: [\n {\n
strings_as_keywords: {\n path_match: 'kibana.alert.grouping.*',\n
match_mapping_type: 'string',\n mapping: {\n type: 'keyword',\n
ignore_above: 1024,\n },\n },\n },\n ],\n```\n\nThe result of adding
these mappings can be seen
below:\n|Alert|Mapping|\n|---|---|\n\n|||\n\nIf
the number of mapping limit is exceeded, the fields that are not\nmapped
are going to be added to the `_ignored` field, but the value
is\navailable in the
doc.\n\n<img\nsrc=\"https://github.com/user-attachments/assets/b84bcf03-b757-4f37-a93f-2559aefa5bcf\"\nwidth=500
/>","sha":"1ec32967f857f6e6e2b9f45f4da5751997254e4e"}},{"branch":"8.19","label":"v8.19.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->
---------
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Relaetd to #183248
Auto-increasing mapping limit PR: #216719
Summary
In this PR, we are saving dynamically mapped group by information for the custom threshold rule. This consists of two parts:
The result of adding these mappings can be seen below:
If the number of mapping limit is exceeded, the fields that are not mapped are going to be added to the
_ignoredfield, but the value is available in the doc.