I saw many topic regarding this subject. But I need to add mine because maybe there are some solutions that exists since.
I am using Elastic and Kibana 7
I need to pass some specific filters to my iframe from my react application.
These filters are some user id or specific role.
These datas exists in my elastic index and I just need to add them to filter my kibana dashboard.
When I share my dashboard, I have to use the saved object option to have access to some variables (_g and _a)
I saw the way to add filters into _g and _a variables.
But when I do that, the filter clearly appear in the filter bar, and the user is able to remove it and see the whole datas. That's not what I want.
If I remove the Filter bar from the Iframe, it may be a solution, but if a user clicks on a lens to activate a filter, I never saw where I can remove this new filter.
And I don't see any APIs to alter the dashboards views with filters.
If I resume : is there a simple way to add a filter that is not removable my the user to existing dashbord ?
Is Kibana 7 able to do that ? Maybe Kibana 8 ? Maybe an API ?
Welcome! You are correct that there's not an explicit API to alter the filters, so you need to use the _g and _a variables. This applies to both Kibana 7 and 8.
I would recommend removing the filter bar using the hide-filter-bar option in the URL. It's covered in this blog.
I'm not sure what you mean by the above. Have you granted readonly access to your dashboard on the embedded authentication settings?
Thanks to confirm that it will be difficult to find a solution But your link seems to describe a way to send data from outside a iframe. That may be very useful and I will check that.
Let me try to explain : imagine you have a dashboard with multiple lenses. You have one lens that shows, for example, some countries with a pie chart.
If you click on one of the segments of the pie chart (let's say France), each other lenses will reflect the change and display the new datas with the country France selected.
You will see this new filter inside the filter bar (country:France). You can remove this filter by clicking the X in the filter bar.
But if you decide not to show the filter bar when you share the dashboard, how can you remove this specific filter "France" ?
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.