[9.2] [SLO] Fix SLO filter containing space and wildcard (#251033)#251197
Merged
kibanamachine merged 3 commits intoelastic:9.2from Feb 5, 2026
Merged
[9.2] [SLO] Fix SLO filter containing space and wildcard (#251033)#251197kibanamachine merged 3 commits intoelastic:9.2from
kibanamachine merged 3 commits intoelastic:9.2from
Conversation
Fixes elastic#250781 Fixes elastic#251039 ## Summary Currently in SLO edit/create form when user uses a filter query that contains a space followed by a wildcard character (`tags: hello *`), it behaves as if it's using Lucene syntax instead of KQL (generates `query_string` queries instead of `wildcard` queries for keyword fields). `query_string` uses Lucene syntax which handles spaces and wildcards differently than KQL, leading to queries matching all documents or no documents instead of the intended subset. ## Root cause The `getElasticsearchQueryOrThrow` function accepts an optional `dataView` parameter that is required for `buildEsQuery` to determine field types (keyword vs text vs other types). With a missing dataView [getFields](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-es-query/src/kuery/functions/utils/get_fields.ts#L14)() can't find the field in the dataView, so it falls back to a field with no type info, causing `query_string` instead of `wildcard` This PR fixes various calls to `getElasticsearchQueryOrThrow` to include a `dataView`. It also fixes a visual issue with the preview chart, where it appeared to be empty where sliValue = 0. Now it shows a line at the 0% level for those time intervals where good events might be 0. ## After, tags: hello *, only hello all documents returned <img width="1126" height="465" alt="542489023-4f0a0439-3615-436b-a265-132a929563f9" src="https://github.com/user-attachments/assets/48267637-2b8d-48ae-ac41-bf452804ab7e" /> ## SLO documents flyout showing only documents with hello all tag <img width="1308" height="528" alt="Screenshot 2026-01-30 at 01 43 04" src="https://github.com/user-attachments/assets/dc880ca9-6baa-4a72-a8be-0d6e0a52fcda" /> --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> (cherry picked from commit 96eb62c)
Contributor
|
Pinging @elastic/obs-ux-management-team (Team:obs-ux-management) |
Contributor
⏳ Build in-progress, with failures
Failed CI Steps
Test Failures
History
cc @mgiota |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport
This will backport the following commits from
mainto9.2:Questions ?
Please refer to the Backport tool documentation