# Create programable links with enabled custom filters to Kibana Dashboard

**URL:** <https://discuss.elastic.co/t/create-programable-links-with-enabled-custom-filters-to-kibana-dashboard/267243>\
**Category:** Kibana\
**Created:** [March 15, 2021, 10:06am UTC](https://discuss.elastic.co/t/create-programable-links-with-enabled-custom-filters-to-kibana-dashboard/267243 "2021-03-15T10:06:47Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Treki](https://avatars.discourse-cdn.com/v4/letter/t/e480ec/32.png) [@Treki](https://discuss.elastic.co/u/Treki)\
**Post date:** [March 15, 2021, 10:06am UTC](https://discuss.elastic.co/t/create-programable-links-with-enabled-custom-filters-to-kibana-dashboard/267243/1 "2021-03-15T10:06:47Z")

</div>

Hello,

my company is testing Kibana in order to check if the programme is usable for our business case.  
We want to create programable links with enabled custom filters to Kibana Dashboard:

 ![filters](https://us1.discourse-cdn.com/elastic/original/3X/b/5/b58393210ffe35b729b0d36c18bc05edbf3e0846.png)

I know, there is the possibility to create permalinks:  
 ![Permalink](https://us1.discourse-cdn.com/elastic/original/3X/d/b/dbb4867953a573cadc0e327d541ea85dfc068965.png)

However, I want to create more than 10.000 links with enabled filters to Kibana Dashboard.  
It will cost too much time to create these links through the provided option.

Therefore, I want to ask if it is possible if we can create these links in a programmable way, e.g. with Python.

With best regards

---

<div class="post-metadata">

**Author:** ![lukeelmers](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lukeelmers/32/35230_2.png) [@lukeelmers](https://discuss.elastic.co/u/lukeelmers)\
**Post date:** [March 15, 2021, 8:14pm UTC](https://discuss.elastic.co/t/create-programable-links-with-enabled-custom-filters-to-kibana-dashboard/267243/2 "2021-03-15T20:14:05Z")

</div>

You could try writing a script that calls the [shorten url api](https://www.elastic.co/guide/en/kibana/current/url-shortening-api.html) directly. However there are few caveats when it comes to permalinks in Kibana:

1. Short urls are currently not "cleaned up", meaning once you create them, they remain in your `.kibana` index forever. So keep this in mind if you plan on creating large numbers of them. (You can, of course, delete them manually should you choose to do so).
2. Kibana's URL parameters are [still not officially considered a part of Kibana's APIs](https://github.com/elastic/kibana/issues/4338). While we have worked very hard not to break them, there remains a slight risk that short URLs you have created previously could change. (This is a risk no matter how you create short URLs, be it programmatically or via the UI).

We are actively planning a better solution for (2), but aside from waiting on that, writing a script to call the existing API directly sounds like it's probably your only option at the moment.

---

<div class="post-metadata">

**Author:** ![Treki](https://avatars.discourse-cdn.com/v4/letter/t/e480ec/32.png) [@Treki](https://discuss.elastic.co/u/Treki)\
**Post date:** [March 19, 2021, 1:17pm UTC](https://discuss.elastic.co/t/create-programable-links-with-enabled-custom-filters-to-kibana-dashboard/267243/3 "2021-03-19T13:17:54Z")

</div>

@lukeelmers @AClerk  
Thank you for your reply!

I do not want to shorten URLs, I want to create URLs for the **same** dashboard with different filters. Is there anything planned to tackle this problem?

What are you thinking about this Python script?

> **[gbit-is/kibana-URL-filter-creator](https://github.com/gbit-is/kibana-URL-filter-creator)**
>
> A small flask service that generates Kibana dashboard URL's with filters preset

---

<div class="post-metadata">

**Author:** ![Felix\_Roessel](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/felix_roessel/32/41623_2.png) [@Felix\_Roessel](https://discuss.elastic.co/u/Felix_Roessel)\
**Post date:** [March 19, 2021, 3:33pm UTC](https://discuss.elastic.co/t/create-programable-links-with-enabled-custom-filters-to-kibana-dashboard/267243/4 "2021-03-19T15:33:00Z")

</div>

In this case you add the filter to your dashboard first.  
The filter and its value is part of the URL parameters.

You can change them and inject the values you want to filter for.

---

<div class="post-metadata">

**Author:** ![Treki](https://avatars.discourse-cdn.com/v4/letter/t/e480ec/32.png) [@Treki](https://discuss.elastic.co/u/Treki)\
**Post date:** [March 22, 2021, 3:26pm UTC](https://discuss.elastic.co/t/create-programable-links-with-enabled-custom-filters-to-kibana-dashboard/267243/5 "2021-03-22T15:26:53Z")

</div>

thank you!  
It worked!

---

<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:** [April 19, 2021, 3:27pm UTC](https://discuss.elastic.co/t/create-programable-links-with-enabled-custom-filters-to-kibana-dashboard/267243/6 "2021-04-19T15:27:11Z")

</div>

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