[8.19] [One Discover] Prevent search highlighting markup in logs overview field action filters (#227652)#229288
Merged
rStelmach merged 5 commits intoelastic:8.19from Jul 25, 2025
Conversation
…eld action filters (elastic#227652) closes : elastic#226375 ## Summary 📚 Fixes an issue where HTML search highlighting markup (`<mark>` tags) was incorrectly carried over into filter values when using field actions "Filter for value" in the logs overview tab. ### Problem 🐛 When searching in Discover and using field actions in the logs overview tab's content breakdown section, the generated filters would contain HTML markup instead of clean field values. The logs overview components were using the formatted/highlighted field values (which contain ` <mark> ` tags for visual highlighting) directly in field actions, instead of accessing the original, clean field values from the raw document. ### Solution Instead of trying to strip HTML markup (which could accidentally remove legitimate HTML content from log messages), this fix implements a cleaner approach which is passing raw document data. ## Demo 🎥 https://github.com/user-attachments/assets/286db889-e54b-4026-b5bc-0e3ca9e1ea58 ## How to test 🔬 - Ingest log data (e.g by using Synthtrace node scripts/synthtrace.js simple_logs) - Write a search query that matches part or all of the message - Open the doc flyout and use an action for the message field ## Open discussion 🗣️ This solution is also handling an edge case when a message can contain `<mark>` html element and that's why we are passing raw doc message. If that is too much we can just use regex to filter out `<mark>` html markups caused by our highlighting. LMK (cherry picked from commit d94e367)
Contributor
💔 Build Failed
Failed CI StepsTest Failures
Metrics [docs]Async chunks
History
cc @rStelmach |
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
mainto8.19:Questions ?
Please refer to the Backport tool documentation