# Kibana' Short URLs

**URL:** <https://discuss.elastic.co/t/kibana-short-urls/367117>\
**Category:** Kibana\
**Created:** [September 25, 2024, 4:18pm UTC](https://discuss.elastic.co/t/kibana-short-urls/367117 "2024-09-25T16:18:30Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![alexus](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/alexus/32/12696_2.png) [@alexus](https://discuss.elastic.co/u/alexus)\
**Post date:** [September 25, 2024, 4:18pm UTC](https://discuss.elastic.co/t/kibana-short-urls/367117/1 "2024-09-25T16:18:30Z")

</div>

hello world 😉

let me backup a bit and start from the beginning ...  
it all started when we saw this msg:

```auto
{"type":"log","@timestamp":"2024-09-24T16:09:22+00:00","tags":["error","savedobjects-service"],"pid":7,"message":"[.kibana] Action failed with '[timeout_exception] Timed out waiting for completion of [org.elasticsearch.index.reindex.BulkByScrollTask@419e8dfa]'. Retrying attempt 1 in 2 seconds."}
{"type":"log","@timestamp":"2024-09-24T16:09:22+00:00","tags":["info","savedobjects-service"],"pid":7,"message":"[.kibana] UPDATE_TARGET_MAPPINGS_WAIT_FOR_TASK -> UPDATE_TARGET_MAPPINGS_WAIT_FOR_TASK. took: 60088ms."}
{"type":"log","@timestamp":"2024-09-24T16:10:24+00:00","tags":["error","savedobjects-service"],"pid":7,"message":"[.kibana] Action failed with '[timeout_exception] Timed out waiting for completion of [org.elasticsearch.index.reindex.BulkByScrollTask@419e8dfa]'. Retrying attempt 1 in 2 seconds."}
{"type":"log","@timestamp":"2024-09-24T16:10:24+00:00","tags":["info","savedobjects-service"],"pid":7,"message":"[.kibana] UPDATE_TARGET_MAPPINGS_WAIT_FOR_TASK -> UPDATE_TARGET_MAPPINGS_WAIT_FOR_TASK. took: 62086ms."}
{"type":"log","@timestamp":"2024-09-24T16:11:26+00:00","tags":["error","savedobjects-service"],"pid":7,"message":"[.kibana] Action failed with '[timeout_exception] Timed out waiting for completion of [org.elasticsearch.index.reindex.BulkByScrollTask@419e8dfa]'. Retrying attempt 1 in 2 seconds."}

```

to reduce number of saved-objects, i ran \_count and then \_delete\_by\_query to delete saved objects that has `accessCount:0` and are older then `7d` based on `accessDate`, like so:

```auto
GET /.kibana_7*/_count
{"query":{"bool":{"filter":[{"term":{"type":"url"}}],"should":[{"term":{"url.accessCount":0}},{"range":{"url.accessDate":{"lt":"now-7d"}}}],"minimum_should_match":1}}}

```

which returned me nearly 5M documents, so I ran following:

```auto
POST /.kibana_7*/_delete_by_query?wait_for_completion=false
{"query":{"bool":{"filter":[{"term":{"type":"url"}}],"should":[{"term":{"url.accessCount":0}},{"range":{"url.accessDate":{"lt":"now-7d"}}}],"minimum_should_match":1}}}

```

I then re-run \_count query and number is low, however some users are reporting that their short links aren't working anymore..

so i created _NEW_ link, opened it and checked accessCount, yet it's still shows _0_

What's the better way to deal with purging _inactive_ short urls?

Please advise)  
Thanks!

please advise.
