# Deleting Kibana Index patterns and dependencies

**URL:** <https://discuss.elastic.co/t/deleting-kibana-index-patterns-and-dependencies/299111>\
**Category:** Kibana\
**Created:** [March 8, 2022, 3:34pm UTC](https://discuss.elastic.co/t/deleting-kibana-index-patterns-and-dependencies/299111 "2022-03-08T15:34:31Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![nkuntla](https://avatars.discourse-cdn.com/v4/letter/n/779978/32.png) [@nkuntla](https://discuss.elastic.co/u/nkuntla)\
**Post date:** [March 8, 2022, 3:34pm UTC](https://discuss.elastic.co/t/deleting-kibana-index-patterns-and-dependencies/299111/1 "2022-03-08T15:34:31Z")

</div>

Trying to delete multiple index patterns in our kibana instance that are junk.

Some questions related to this.

- Will deleting the index pattern delete dependent visualizations and dashboards?
- Will the delete fail if there are dependent visualizations and dashboards?
- Will the delete leave orphaned objects? If so, can we determine the dependent objects prior to deleting the index patterns and delete them first.

---

<div class="post-metadata">

**Author:** ![jsanz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jsanz/32/53734_2.png) [@jsanz](https://discuss.elastic.co/u/jsanz)\
**Post date:** [March 8, 2022, 5:31pm UTC](https://discuss.elastic.co/t/deleting-kibana-index-patterns-and-dependencies/299111/2 "2022-03-08T17:31:29Z")

</div>

> [@nkuntla](#):
>
> Will deleting the index pattern delete dependent visualizations and dashboards?

No

> [@nkuntla](#):
>
> Will the delete fail if there are dependent visualizations and dashboards?

No, it won't fail

> [@nkuntla](#):
>
> Will the delete leave orphaned objects? If so, can we determine the dependent objects prior to deleting the index patterns and delete them first.

Correct, you can have saved objects that reference to a deleted objects, and they are usually called out when loading.

You can check any saved object dependencies from the `Stack Management -> Saved Objects` interface checking for the `Relationships` of a given Saved Object.

Example: I have a data view (current name for Index Patterns) called `airports` that used on a map `Airports Map`. If I remove the data view the map will complain that this data view is missing.

![Peek 2022-03-08 18-29](https://us1.discourse-cdn.com/elastic/original/3X/7/4/74a8bae58e6d41151e930019cd38cd46a9b5d347.gif)

---

<div class="post-metadata">

**Author:** ![nkuntla](https://avatars.discourse-cdn.com/v4/letter/n/779978/32.png) [@nkuntla](https://discuss.elastic.co/u/nkuntla)\
**Post date:** [March 8, 2022, 6:10pm UTC](https://discuss.elastic.co/t/deleting-kibana-index-patterns-and-dependencies/299111/3 "2022-03-08T18:10:11Z")

</div>

Thanks for your response.

Can this be done via API?

---

<div class="post-metadata">

**Author:** ![jsanz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jsanz/32/53734_2.png) [@jsanz](https://discuss.elastic.co/u/jsanz)\
**Post date:** [March 9, 2022, 2:37pm UTC](https://discuss.elastic.co/t/deleting-kibana-index-patterns-and-dependencies/299111/4 "2022-03-09T14:37:40Z")

</div>

Yep, check the Saved Objects API, it gives you info on object references, create and remove objects, and so on.

> **[Saved objects APIs | Kibana Guide \[8.1\] | Elastic](https://www.elastic.co/guide/en/kibana/8.1/saved-objects-api.html)**
>
> Conceptual and step-by-step procedures for using runtime fields, scripted fields, and field formatters.

---

<div class="post-metadata">

**Author:** ![nkuntla](https://avatars.discourse-cdn.com/v4/letter/n/779978/32.png) [@nkuntla](https://discuss.elastic.co/u/nkuntla)\
**Post date:** [March 10, 2022, 9:47pm UTC](https://discuss.elastic.co/t/deleting-kibana-index-patterns-and-dependencies/299111/5 "2022-03-10T21:47:06Z")

</div>

I am running on version 6.8

Is that an issue? What would change in that case?

---

<div class="post-metadata">

**Author:** ![jsanz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jsanz/32/53734_2.png) [@jsanz](https://discuss.elastic.co/u/jsanz)\
**Post date:** [March 14, 2022, 3:09pm UTC](https://discuss.elastic.co/t/deleting-kibana-index-patterns-and-dependencies/299111/6 "2022-03-14T15:09:52Z")

</div>

6.8 has also the relationships feature for Saved Objects

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/9/d/9df47b036436c0594f1f4f9b6d2820b7e61341b2.png)

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/d/9/d98a386bf53621ade5bbf328c6de40bc4c00e173.png)

And similarly, if you remove a child object (like an index pattern) the dependant objects will complain about the missing one

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/5/6/56be787c68947205ed7daf1db55eebd8cc9571c9.png)

You can try this yourself with the sample data just creating a new index pattern and a dashboard on it and then remove the pattern.

---

<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 11, 2022, 3:10pm UTC](https://discuss.elastic.co/t/deleting-kibana-index-patterns-and-dependencies/299111/7 "2022-04-11T15:10:21Z")

</div>

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