Skip to content

Commit

Permalink
[7.17] Improves pattern matching for data telemetry (#197876) (#200739)
Browse files Browse the repository at this point in the history
# Backport

This will backport the following commits from `main` to `7.17`:
- [Improves pattern matching for data telemetry
(#197876)](#197876)

<!--- Backport version: 9.4.3 -->

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

<!--BACKPORT [{"author":{"name":"Christiane (Tina)
Heiligers","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-10-28T19:30:02Z","message":"Improves
pattern matching for data telemetry (#197876)\n\n##
Summary\r\n\r\nAddresses concerns with Regex
matching.\r\n\r\nCo-authored-by: Elastic Machine
<[email protected]>","sha":"943b273c4b2d5c7b018054d02e63c3c466c43d52","branchLabelMapping":{"^v9.0.0$":"main","^v8.17.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Team:Core","release_note:skip","v9.0.0","backport:version","v8.17.0","v7.17.26"],"title":"Improves
pattern matching for data
telemetry","number":197876,"url":"https://github.com/elastic/kibana/pull/197876","mergeCommit":{"message":"Improves
pattern matching for data telemetry (#197876)\n\n##
Summary\r\n\r\nAddresses concerns with Regex
matching.\r\n\r\nCo-authored-by: Elastic Machine
<[email protected]>","sha":"943b273c4b2d5c7b018054d02e63c3c466c43d52"}},"sourceBranch":"main","suggestedTargetBranches":["7.17"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/197876","number":197876,"mergeCommit":{"message":"Improves
pattern matching for data telemetry (#197876)\n\n##
Summary\r\n\r\nAddresses concerns with Regex
matching.\r\n\r\nCo-authored-by: Elastic Machine
<[email protected]>","sha":"943b273c4b2d5c7b018054d02e63c3c466c43d52"}},{"branch":"8.x","label":"v8.17.0","branchLabelMappingKey":"^v8.17.0$","isSourceBranch":false,"url":"https://github.com/elastic/kibana/pull/198079","number":198079,"state":"MERGED","mergeCommit":{"sha":"dd4386e432190eb01c7c2c509283326ccb66c3ea","message":"[8.x]
Improves pattern matching for data telemetry (#197876) (#198079)\n\n#
Backport\n\nThis will backport the following commits from `main` to
`8.x`:\n- [Improves pattern matching for data
telemetry\n(#197876)](https://github.com/elastic/kibana/pull/197876)\n\n<!---
Backport version: 9.4.3 -->\n\n### Questions ?\nPlease refer to the
[Backport
tool\ndocumentation](https://github.com/sqren/backport)\n\n<!--BACKPORT
[{\"author\":{\"name\":\"Christiane
(Tina)\nHeiligers\",\"email\":\"[email protected]\"},\"sourceCommit\":{\"committedDate\":\"2024-10-28T19:30:02Z\",\"message\":\"Improves\npattern
matching for data telemetry
(#197876)\\n\\n##\nSummary\\r\\n\\r\\nAddresses concerns with
Regex\nmatching.\\r\\n\\r\\nCo-authored-by: Elastic
Machine\n<[email protected]>\",\"sha\":\"943b273c4b2d5c7b018054d02e63c3c466c43d52\",\"branchLabelMapping\":{\"^v9.0.0$\":\"main\",\"^v8.17.0$\":\"8.x\",\"^v(\\\\d+).(\\\\d+).\\\\d+$\":\"$1.$2\"}},\"sourcePullRequest\":{\"labels\":[\"Team:Core\",\"release_note:skip\",\"v9.0.0\",\"backport:prev-minor\",\"v8.17.0\"],\"title\":\"Improves\npattern
matching for
data\ntelemetry\",\"number\":197876,\"url\":\"https://github.com/elastic/kibana/pull/197876\",\"mergeCommit\":{\"message\":\"Improves\npattern
matching for data telemetry
(#197876)\\n\\n##\nSummary\\r\\n\\r\\nAddresses concerns with
Regex\nmatching.\\r\\n\\r\\nCo-authored-by: Elastic
Machine\n<[email protected]>\",\"sha\":\"943b273c4b2d5c7b018054d02e63c3c466c43d52\"}},\"sourceBranch\":\"main\",\"suggestedTargetBranches\":[\"8.x\"],\"targetPullRequestStates\":[{\"branch\":\"main\",\"label\":\"v9.0.0\",\"branchLabelMappingKey\":\"^v9.0.0$\",\"isSourceBranch\":true,\"state\":\"MERGED\",\"url\":\"https://github.com/elastic/kibana/pull/197876\",\"number\":197876,\"mergeCommit\":{\"message\":\"Improves\npattern
matching for data telemetry
(#197876)\\n\\n##\nSummary\\r\\n\\r\\nAddresses concerns with
Regex\nmatching.\\r\\n\\r\\nCo-authored-by: Elastic
Machine\n<[email protected]>\",\"sha\":\"943b273c4b2d5c7b018054d02e63c3c466c43d52\"}},{\"branch\":\"8.x\",\"label\":\"v8.17.0\",\"branchLabelMappingKey\":\"^v8.17.0$\",\"isSourceBranch\":false,\"state\":\"NOT_CREATED\"}]}]\nBACKPORT-->\n\nCo-authored-by:
Christiane (Tina) Heiligers
<[email protected]>"}},{"branch":"7.17","label":"v7.17.26","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Christiane (Tina) Heiligers <[email protected]>
  • Loading branch information
kibanamachine and TinaHeiligers authored Nov 19, 2024
1 parent da223f8 commit 2ed05e4
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,8 @@ function findMatchingDescriptors({
// avoid system indices caught by very fuzzy index patterns (i.e.: *log* would catch `.kibana-log-...`)
return false;
}
return new RegExp(`^${pattern.replace(/\./g, '\\.').replace(/\*/g, '.*')}$`).test(name);
const escapedPattern = pattern.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&');
return new RegExp(`^${escapedPattern.replace(/\\\*/g, '.*')}$`).test(name);
});
}

Expand Down

0 comments on commit 2ed05e4

Please sign in to comment.