-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Custom filter warnings incorrectly shown on the rule editing page #181643
Comments
Pinging @elastic/security-detection-engine (Team:Detection Engine) |
Looks like this issue might have been fixed earlier. Could not reproduce it on 8.16(main) Screen.Recording.2024-09-30.at.14.15.34.movCan you look at it and verify whether this still an actual issue? |
@vitaliidm Interesting! Just checked on latest |
I was able to reproduce issue using AND filter. @nikitaindik , can you verify if you still can reproduce after the fix? |
Thanks @vitaliidm! I have checked on latest main and can confirm that it doesn't reproduce. Do you think the fix should also be backported to previous Kibana versions? |
Backported to 8.15.3 |
@pborgonovi 8.15.3 BC has been built already, please validate the fix and keep the ticket open until is validated in 8.16.0 BC, thanks! |
Hi @vitaliidm I've checked 8.15.3 BC and issue persists as per the evidence below: Screen.Recording.2024-10-11.at.11.20.53.AM.movAs per what I could check the backport was succeeded. Would you please double check this one? |
Pinging @elastic/security-detections-response (Team:Detections and Resp) |
looks like this fix did not make to 8.15.3, despite PR being labeled as 8.15.3 by Kibana bot. |
Thanks for the analysis @vitaliidm I'll make sure to validate 8.15.4 and 8.16 BC |
Issue is fixed in 8.16 Screen.Recording.2024-10-18.at.9.00.00.AM.movWaiting to validate in 8.15.4 |
Issue is fixed in 8.15.4 Screen.Recording.2024-11-05.at.2.53.35.PM.movClosing this bug as fixed |
We've recently received SDH #945 (internal). The issue there seems to be caused by a bug on the rule editing page. When editing a rule with custom filters, QueryBar displays warnings for filters, even though there's nothing wrong with filters' configuration.
It's a UI-only issue. It doesn't affect submitted data or rule execution.
The issue reproduces only if you go into edit mode by clicking the "Edit rule settings" button. It works as expected if you navigate to the edit page directly or if you reload the edit page.
Kibana version:
8.11.x
Steps to reproduce:
(also see video below)
logs-*
)*
){"regexp":{"file.path":{"value":".*abc"}}}
)filters_warning.mp4
Expected behavior:
Any additional context:
There seems to be a race condition.
EditRulePageComponent
: We fetchindexPattern
using theuseRuleIndexPattern
hook. Initially, while the hook is still fetching, it returns an "empty" object{ fields: [], title: "" }
This "empty" object is passed down the components tree as
indexPattern
prop until it reaches theQueryBar
component.QueryBar
has auseEffect
that listens forindexPattern
changes.QueryBar's useEffect checks whether the
indexPattern
prop value is a data view.If it's a data view: it sets it into state (and uses it later to render filters).
If it's not a data view: the code inside useEffect creates a data view from it using an async call like this:
dv = await data.dataViews.create({ id: indexPattern.title, title: indexPattern.title });
...
EditRulePageComponent
: A moment lateruseRuleIndexPattern
finishes fetching the index pattern and returns it instead of an "empty" index pattern. This proper object is passed down the components tree asindexPattern
prop until it reaches theQueryBar
component.indexPattern
prop. This data view object is then set into state, replacing the good data view that was set in step 5.FilterItem
component as a prop.FilterItem
shows a warning.To fix this we might consider:
indexPattern
down toQueryBar
before it's fetched{ fields: [], title: "" }
Similar SDH issue with some background info: https://github.com/elastic/sdh-kibana/issues/3254
The text was updated successfully, but these errors were encountered: