[Inspect] Fix indexpattern parsing leading to incomplete index pattern values being displayed#221084
Conversation
|
/ci |
|
/ci |
|
Pinging @elastic/kibana-data-discovery (Team:DataDiscovery) |
src/platform/plugins/shared/data/common/search/search_source/search_source.ts
Outdated
Show resolved
Hide resolved
src/platform/plugins/shared/data/common/search/search_source/search_source.test.ts
Show resolved
Hide resolved
There was a problem hiding this comment.
Pull Request Overview
This PR refactors the index-pattern parsing logic in the Inspect panel to correctly capture full index names (including dashes, numbers, periods, etc.), and adds new unit tests to validate various query-string patterns.
- Updated the regular expression in
parseActiveIndexPatternFromQueryStringto be more flexible. - Added a suite of tests covering quoted, wildcarded, and multiple index patterns.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/platform/plugins/shared/data/common/search/search_source/search_source.ts | Replaced old regex with indexNameRegExp and adjusted loop logic to prevent infinite matches. |
| src/platform/plugins/shared/data/common/search/search_source/search_source.test.ts | Introduced parameterized tests for parseActiveIndexPatternFromQueryString. |
Comments suppressed due to low confidence (1)
src/platform/plugins/shared/data/common/search/search_source/search_source.test.ts:1620
- Add a test case for index patterns that include periods (e.g., 'logs-2024.06.27') to ensure the regex captures dots correctly.
describe('parseActiveIndexPatternFromQueryString', () => {
src/platform/plugins/shared/data/common/search/search_source/search_source.ts
Outdated
Show resolved
Hide resolved
src/platform/plugins/shared/data/common/search/search_source/search_source.ts
Outdated
Show resolved
Hide resolved
|
@elasticmachine merge upstream |
|
Starting backport for target branches: 8.19 |
💚 Build Succeeded
Metrics [docs]Page load bundle
History
cc @kertal |
…n values being displayed (elastic#221084) Fixes the parsing of index patterns in the Inspect feature. Previously, certain index pattern strings were not being parsed and displayed correctly. (cherry picked from commit 931e277)
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
… pattern values being displayed (#221084) (#222145) # Backport This will backport the following commits from `main` to `8.19`: - [[Inspect] Fix indexpattern parsing leading to incomplete index pattern values being displayed (#221084)](#221084) <!--- Backport version: 9.6.6 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Matthias Wilhelm","email":"matthias.wilhelm@elastic.co"},"sourceCommit":{"committedDate":"2025-06-02T05:35:51Z","message":"[Inspect] Fix indexpattern parsing leading to incomplete index pattern values being displayed (#221084)\n\nFixes the parsing of index patterns in the Inspect feature. Previously, certain index pattern strings were not\nbeing parsed and displayed correctly.","sha":"931e277e4a25010e3971b5723356e4717a0caf64","branchLabelMapping":{"^v9.1.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Feature:Discover","release_note:fix","Team:DataDiscovery","backport:version","v9.1.0","v8.19.0"],"title":"[Inspect] Fix indexpattern parsing leading to incomplete index pattern values being displayed","number":221084,"url":"https://github.com/elastic/kibana/pull/221084","mergeCommit":{"message":"[Inspect] Fix indexpattern parsing leading to incomplete index pattern values being displayed (#221084)\n\nFixes the parsing of index patterns in the Inspect feature. Previously, certain index pattern strings were not\nbeing parsed and displayed correctly.","sha":"931e277e4a25010e3971b5723356e4717a0caf64"}},"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/221084","number":221084,"mergeCommit":{"message":"[Inspect] Fix indexpattern parsing leading to incomplete index pattern values being displayed (#221084)\n\nFixes the parsing of index patterns in the Inspect feature. Previously, certain index pattern strings were not\nbeing parsed and displayed correctly.","sha":"931e277e4a25010e3971b5723356e4717a0caf64"}},{"branch":"8.19","label":"v8.19.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Matthias Wilhelm <matthias.wilhelm@elastic.co>
…n values being displayed (elastic#221084) Fixes the parsing of index patterns in the Inspect feature. Previously, certain index pattern strings were not being parsed and displayed correctly.
…n values being displayed (elastic#221084) Fixes the parsing of index patterns in the Inspect feature. Previously, certain index pattern strings were not being parsed and displayed correctly.
Summary
Fixes #187103
This pull request fixes the parsing of index patterns in the [Inspect] feature of Kibana. Previously, certain index pattern strings were not being parsed and displayed correctly in the which was visible in the Inspec feature.
Changes applied
Testing Instructions
_indexwithout using wildcards (e.g._index: logs-2024-06-27)Expected behavior:
It would show the "Index Pattern" as
logs-2024-06-27. Instead, just previouslylogs-was displayed, here's a screen of the previous behaviorChecklist