# Iframe Dashboard Filters

**URL:** <https://discuss.elastic.co/t/iframe-dashboard-filters/229618>\
**Category:** Kibana\
**Created:** [April 24, 2020, 10:19am UTC](https://discuss.elastic.co/t/iframe-dashboard-filters/229618 "2020-04-24T10:19:50Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![tonyskulk](https://avatars.discourse-cdn.com/v4/letter/t/3be4f8/32.png) [@tonyskulk](https://discuss.elastic.co/u/tonyskulk)\
**Post date:** [April 24, 2020, 10:19am UTC](https://discuss.elastic.co/t/iframe-dashboard-filters/229618/1 "2020-04-24T10:19:50Z")

</div>

Hi, I have read a lot about this topic but could not get it to work.

The simple problem:  
I want to include my dashboard in my own webapp. This works fine by using share-\>iframe.  
Now I want to be able to specify filters/query in the iframe url so that the filters apply to the dashboard on loading.

As there is no documentation, what is the correct syntax for the URL (I tried so many things and it did not work ☹).

I am using Kibana 7.6.

My dashboard url (not the shared one) is:

```
http://localhost:15601/app/kibana#/dashboard/0b98b270-85db-11ea-bb8a-31c7626f733e?_a=(description:'',filters:!(('$state':(store:appState),meta:(alias:!n,disabled:!f,index:'3ba7f160-8081-11ea-bb8a-31c7626f733e',key:session_id,negate:!f,params:(query:'5ea0fa0e3b3af50001c9d080'),type:phrase),query:(match_phrase:(session_id:'5ea0fa0e3b3af50001c9d080'))),('$state':(store:appState),meta:(alias:!n,disabled:!f,index:'3ba7f160-8081-11ea-bb8a-31c7626f733e',key:stage,negate:!f,params:(query:test),type:phrase),query:(match_phrase:(stage:test)))),fullScreenMode:!f,options:(hidePanelTitles:!f,useMargins:!f),panels:!((embeddableConfig:(),gridData:(h:16,i:'9ee02dfb-1820-44d5-89fa-daa971c45285',w:48,x:0,y:0),id:'4a6c0f50-8474-11ea-bb8a-31c7626f733e',panelIndex:'9ee02dfb-1820-44d5-89fa-daa971c45285',type:visualization,version:'7.6.1'),(embeddableConfig:(),gridData:(h:15,i:e50f6ee6-2fb2-4174-8657-4d61f24479bc,w:24,x:0,y:16),id:e56dad00-69c7-11ea-9f53-2bb6e65be0de,panelIndex:e50f6ee6-2fb2-4174-8657-4d61f24479bc,type:visualization,version:'7.6.1'),(embeddableConfig:(),gridData:(h:15,i:'241b4b79-ed3b-44e8-8bd5-9502cbe66e5f',w:24,x:24,y:16),id:'6f5b0b00-73d4-11ea-bb8a-31c7626f733e',panelIndex:'241b4b79-ed3b-44e8-8bd5-9502cbe66e5f',type:visualization,version:'7.6.1'),(embeddableConfig:(),gridData:(h:15,i:'82bf4a7c-cd67-45cf-b0d7-d753b8e76a74',w:24,x:0,y:31),id:'5ed019e0-8173-11ea-bb8a-31c7626f733e',panelIndex:'82bf4a7c-cd67-45cf-b0d7-d753b8e76a74',type:visualization,version:'7.6.1'),(embeddableConfig:(),gridData:(h:14,i:da1add6f-9d56-4a91-a2de-7229a2490cf0,w:24,x:24,y:31),id:'4780f3c0-81f7-11ea-bb8a-31c7626f733e',panelIndex:da1add6f-9d56-4a91-a2de-7229a2490cf0,type:visualization,version:'7.6.1')),query:(language:kuery,query:''),timeRestore:!f,title:'Session%20results%20-%20no%20controls',viewMode:view)&_g=(filters:!(),refreshInterval:(pause:!t,value:0),time:(from:now-15m,to:now))

```

The url from the generated iframe code (by share-\>embed\_code-\> saved\_object) is:

```
http://localhost:15601/app/kibana#/dashboard/0b98b270-85db-11ea-bb8a-31c7626f733e?embed=true&_g=(filters%3A!()%2CrefreshInterval%3A(pause%3A!t%2Cvalue%3A0)%2Ctime%3A(from%3Anow-15m%2Cto%3Anow))

```

I have seen someone using something like

```
_a=...

```

but I could not get it to work. Please if some can just simply tell me the correct syntax to use to specify just a simple filter or a list of filters.

Thanks

---

<div class="post-metadata">

**Author:** ![mattkime](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mattkime/32/43522_2.png) [@mattkime](https://discuss.elastic.co/u/mattkime)\
**Post date:** [April 24, 2020, 12:38pm UTC](https://discuss.elastic.co/t/iframe-dashboard-filters/229618/2 "2020-04-24T12:38:56Z")

</div>

Hello @tonyskulk,

Filter state is stored in the url. If you create a dashboard that has the filters you desire and then generate the embedded code you should have whaat you need.

--Matt

---

<div class="post-metadata">

**Author:** ![tonyskulk](https://avatars.discourse-cdn.com/v4/letter/t/3be4f8/32.png) [@tonyskulk](https://discuss.elastic.co/u/tonyskulk)\
**Post date:** [April 25, 2020, 2:54am UTC](https://discuss.elastic.co/t/iframe-dashboard-filters/229618/3 "2020-04-25T02:54:13Z")

</div>

Hello @mattkime,

thanks for your response.  
I want to update the filters depending on my webapp´s state: Lets say a user is allowed to select a session\_id in my webapp and then I want the iframe-linked dashboard to show only data filtered according to this session\_id.  
So I must be able to dynamically update the url and I dont know how this works. I assume I have to use the \_a request parameter but I really can not understand the syntay. Maybe can someone give me an example working with Kibana 7.6 please?

Many thanks in advance,  
Tony

---

<div class="post-metadata">

**Author:** ![mattkime](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mattkime/32/43522_2.png) [@mattkime](https://discuss.elastic.co/u/mattkime)\
**Post date:** [April 25, 2020, 4:57pm UTC](https://discuss.elastic.co/t/iframe-dashboard-filters/229618/4 "2020-04-25T16:57:20Z")

</div>

Hello @tonyskulk,

You're correct. You'll find what you're looking for in the \_g param. I recommend making a small change to your dashboard (such as applying a filter) and then diffing the url to see how its changed. Here's code thats involved in generating such urls - `src/plugins/dashboard/public/url_generator.ts`

Hope this helps,  
Matt

---

<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:** [May 23, 2020, 4:57pm UTC](https://discuss.elastic.co/t/iframe-dashboard-filters/229618/5 "2020-05-23T16:57:28Z")

</div>

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