# Is kibana supports dynamic filters to a URL?

**URL:** <https://discuss.elastic.co/t/is-kibana-supports-dynamic-filters-to-a-url/244613>\
**Category:** Kibana\
**Created:** [August 11, 2020, 6:04pm UTC](https://discuss.elastic.co/t/is-kibana-supports-dynamic-filters-to-a-url/244613 "2020-08-11T18:04:24Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![kibana\_anil](https://avatars.discourse-cdn.com/v4/letter/k/df705f/32.png) [@kibana\_anil](https://discuss.elastic.co/u/kibana_anil)\
**Post date:** [August 11, 2020, 6:04pm UTC](https://discuss.elastic.co/t/is-kibana-supports-dynamic-filters-to-a-url/244613/1 "2020-08-11T18:04:24Z")

</div>

Is kibana supports dynamic filters to a URL ?

Example -  
create a filter on an index and saved this search.  
copy the URL  
This search URL is associated to the one of the field in Index Pattern. But, I couldn't add different filter URL on the Same index in Index Pattern.  
How can we generate URL with dynamic filters ?

---

<div class="post-metadata">

**Author:** ![flash1293](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/flash1293/32/41227_2.png) [@flash1293](https://discuss.elastic.co/u/flash1293)\
**Post date:** [August 12, 2020, 11:58am UTC](https://discuss.elastic.co/t/is-kibana-supports-dynamic-filters-to-a-url/244613/2 "2020-08-12T11:58:58Z")

</div>

Kibana stores the filters in the URL for Discover/Visualize/Dashboard encoded as rison, so you can dynamically generate a URL containing a certain filter. However you have to make sure to generate a valid filter in there. Consider the following case:

```auto
filters:!(('$state':(store:appState),meta:(alias:!n,disabled:!f,index:'90943e30-9a47-11e8-b64d-95841ca0b247',key:extension.keyword,negate:!f,params:(query:gz),type:phrase),query:(match_phrase:(extension.keyword:gz))))

```

it's equivalent to the following JSON:

```auto
{
    "filters": [
        {
            "$state": {
                "store": "appState"
            },
            "meta": {
                "alias": null,
                "disabled": false,
                "index": "90943e30-9a47-11e8-b64d-95841ca0b247",
                "key": "extension.keyword",
                "negate": false,
                "params": {
                    "query": "gz"
                },
                "type": "phrase"
            },
            "query": {
                "match_phrase": {
                    "extension.keyword": "gz"
                }
            }
        }
    ]
}

```

To change the field and the value it's matching, you have to change it in both the `meta.key` and `meta.params.query` property, as well as in the `query.match_phrase` property.

You can use [https://rison.io/](https://rison.io/) to play around with JSON/RISON to get a feeling for how it works

---

<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:** [September 9, 2020, 11:59am UTC](https://discuss.elastic.co/t/is-kibana-supports-dynamic-filters-to-a-url/244613/3 "2020-09-09T11:59:10Z")

</div>

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