# Will short URLs expire and be deleted?

**URL:** <https://discuss.elastic.co/t/will-short-urls-expire-and-be-deleted/295180>\
**Category:** Kibana\
**Created:** [January 24, 2022, 6:45am UTC](https://discuss.elastic.co/t/will-short-urls-expire-and-be-deleted/295180 "2022-01-24T06:45:28Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![wajika](https://avatars.discourse-cdn.com/v4/letter/w/977dab/32.png) [@wajika](https://discuss.elastic.co/u/wajika)\
**Post date:** [January 24, 2022, 6:45am UTC](https://discuss.elastic.co/t/will-short-urls-expire-and-be-deleted/295180/1 "2022-01-24T06:45:28Z")

</div>

> **[Create short URL API | Kibana Guide \[7.16\] | Elastic](https://www.elastic.co/guide/en/kibana/current/short-urls-api-create.html)**
>
> Kibana provides you with several options to share \*Discover\* saved searches, dashboards, \*Visualize Library\* visualizations, and \*Canvas\* workpads with others, or on a website.

I have a python code that generates a report periodically and creates a lot of short URLs using the short URL API, but I found that kibana or es keep them all the time and won't delete them, and now I just discovered kibana's when migrating data There are always many errors in index (such as Limit of total fields [1000] has been exceeded while adding new fields [XXX]).  
I'm wondering why can't it just expire automatically?

---

<div class="post-metadata">

**Author:** ![tsullivan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tsullivan/32/31077_2.png) [@tsullivan](https://discuss.elastic.co/u/tsullivan)\
**Post date:** [January 25, 2022, 6:20pm UTC](https://discuss.elastic.co/t/will-short-urls-expire-and-be-deleted/295180/2 "2022-01-25T18:20:11Z")

</div>

> [@wajika](#):
>
> There are always many errors in index (such as Limit of total fields [1000] has been exceeded while adding new fields [XXX]).

Not sure how these type of errors can be related to short URLs. Can you provide the errors?

> [@wajika](#):
>
> I'm wondering why can't it just expire automatically?

Short URLs are intended to be shared around in groups and make it easy for people to bookmark places they want to keep going back to. Automatic expiration of the short links would make it pretty ineffective.

---

<div class="post-metadata">

**Author:** ![wajika](https://avatars.discourse-cdn.com/v4/letter/w/977dab/32.png) [@wajika](https://discuss.elastic.co/u/wajika)\
**Post date:** [January 26, 2022, 1:21am UTC](https://discuss.elastic.co/t/will-short-urls-expire-and-be-deleted/295180/3 "2022-01-26T01:21:48Z")

</div>

Hi, thanks for your reply.  
Because the short URL API generates too many links, I get a lot of errors when importing the exported backup data, however, I have confirmed the "Limit of total fields [1000] has been exceeded while adding new fields [XXX]" errors and The short URL API doesn't matter.

As for what you said "Automatic expiration of the short links would make it pretty ineffective." Or can we add a switch that controls whether it expires or not and how long before it will expire?

---

<div class="post-metadata">

**Author:** ![tsullivan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tsullivan/32/31077_2.png) [@tsullivan](https://discuss.elastic.co/u/tsullivan)\
**Post date:** [January 26, 2022, 6:19pm UTC](https://discuss.elastic.co/t/will-short-urls-expire-and-be-deleted/295180/4 "2022-01-26T18:19:02Z")

</div>

I searched through the Kibana issues and couldn't find any requests for a feature that would give an expiration date to short URL objects.

> [@wajika](#):
>
> I have a python code that generates a report periodically and creates a lot of short URLs using the short URL API, but I found that kibana or es keep them all the time and won't delete them

Since you have programmatic access to the new short URLs, I would recommend updating the script to hold on to the IDs that have been created (Kibana returns the ID in the API response), and to delete those IDs after the task is done.

---

<div class="post-metadata">

**Author:** ![wajika](https://avatars.discourse-cdn.com/v4/letter/w/977dab/32.png) [@wajika](https://discuss.elastic.co/u/wajika)\
**Post date:** [January 27, 2022, 2:53pm UTC](https://discuss.elastic.co/t/will-short-urls-expire-and-be-deleted/295180/5 "2022-01-27T14:53:36Z")

</div>

![微信截图_20220127224504](https://us1.discourse-cdn.com/elastic/original/3X/7/8/78a0261703fa6e67cdac7a9b362001498f018519.png)  
 ![微信截图_20220127224448](https://us1.discourse-cdn.com/elastic/original/3X/4/a/4a66165dcfb12cc9c073117b466a3195a405ac13.png)

Because I felt that keeping too many URLs might have an impact on Elasticsearch, I didn't pay attention to this problem until recently, and it was a bit large.  
It would be the best solution to add a function switch, but currently there is no such switch. Then like you said, it can be removed programmatically.

---

<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:** [February 24, 2022, 2:54pm UTC](https://discuss.elastic.co/t/will-short-urls-expire-and-be-deleted/295180/6 "2022-02-24T14:54:16Z")

</div>

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