How to delete all Docs count or remove the Storage Size and bring it to "Zero" for created index patterns in Kibana?

I've created an Index Pattern in Kibana - "cscsv212previousbuild-perfdata" and currently it has some content of Documents (seems to be total count of Docs 177193) and has the Storage Space - 661.9MB.

I would like to delete all the Docs count (0f 177193) and want to bring down the Storage size to "0 MB" for that specifically created Index pattern - "cscsv212previousbuild-perfdata" in Kibana.

How to do that? NOTE: I don't want to delete that "cscsv212previousbuild-perfdata" Index.
Just want to delete all the Docs count and remove the Storage Size. That's all.

I'm currently using the ELastic and Kibana bothe same version "7.17.0".

Hi @hitnalli_praveen.

Are you asking to delete the documents from the index but keep the existing index settings and mappings? That is not currently possible. You need to DELETE the index and then CREATE a new index. If you do this often, you might benefit from creating an Index Template.

Hello @nickpeihl ,

Thank you for responding and clarifying to the query.

Yes, your assumption is right. I was enquiring to delete the documents from the index but keep the existing index settings and mappings. Well, so this is the limitation with Elastic / Kibana, which it couldn't be done then. Fine, so I'll be creating new indices.

Delete the documents from the index by keeping the existing index settings and mappings, why can't that be done ? Can't that be done only w.r.t any particular version of Elastic / Kibana (since I'm currently using 7.17.0 of both. Is that included in any next higher versions ?

Because, where I'm coming on that point is - if the Document counts or Storage Size keep on increases, at some point of time it reaches max point and it might causes to crash any storage / memory of Elastic / Kibana or some services ?

Can this be considered as a requirement ? :slight_smile:

Elasticsearch already provides the ability to use index templates to apply settings and mappings when creating new indices.

If you need to delete an index and keep its settings and mappings you need to create an index template that will be applied when creating a new indice that matchs the index pattern specified in the index template.

1 Like

Because, where I'm coming on that point is - if the Document counts or Storage Size keep on increases, at some point of time it reaches max point and it might causes to crash any storage / memory of Elastic / Kibana or some services ?

In that case, I suggest setting up Index Lifecycle Management.

1 Like

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