Kibana' Short URLs

hello world :wink:

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

{"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:

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:

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.