# Specific Kibana filter in iframe URL and filter bar

**URL:** <https://discuss.elastic.co/t/specific-kibana-filter-in-iframe-url-and-filter-bar/353672>\
**Category:** Kibana\
**Created:** [February 20, 2024, 10:21am UTC](https://discuss.elastic.co/t/specific-kibana-filter-in-iframe-url-and-filter-bar/353672 "2024-02-20T10:21:23Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![skouf](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/skouf/32/122903_2.png) [@skouf](https://discuss.elastic.co/u/skouf)\
**Post date:** [February 20, 2024, 10:21am UTC](https://discuss.elastic.co/t/specific-kibana-filter-in-iframe-url-and-filter-bar/353672/1 "2024-02-20T10:21:23Z")

</div>

Hello

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 ?

Thanks !

---

<div class="post-metadata">

**Author:** ![carly.richmond](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/carly.richmond/32/104935_2.png) [@carly.richmond](https://discuss.elastic.co/u/carly.richmond)\
**Post date:** [February 20, 2024, 11:19am UTC](https://discuss.elastic.co/t/specific-kibana-filter-in-iframe-url-and-filter-bar/353672/2 "2024-02-20T11:19:44Z")

</div>

Hi @skouf,

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](https://www.elastic.co/blog/how-to-embed-kibana-dashboards).

> [@skouf](#):
>
> user clicks on a lens to activate a filter, I never saw where I can remove this new filter.

I'm not sure what you mean by the above. Have you granted readonly access to your dashboard on the embedded authentication settings?

---

<div class="post-metadata">

**Author:** ![skouf](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/skouf/32/122903_2.png) [@skouf](https://discuss.elastic.co/u/skouf)\
**Post date:** [February 20, 2024, 1:45pm UTC](https://discuss.elastic.co/t/specific-kibana-filter-in-iframe-url-and-filter-bar/353672/3 "2024-02-20T13:45:56Z")

</div>

Hello @carly.richmond 🙂

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.

> [@carly.richmond](#):
>
> I'm not sure what you mean by the above. Have you granted readonly access to your dashboard on the embedded authentication settings?

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" ?

Best regards !

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [March 19, 2024, 1:46pm UTC](https://discuss.elastic.co/t/specific-kibana-filter-in-iframe-url-and-filter-bar/353672/4 "2024-03-19T13:46:30Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
