I am trying to automate the deletion of index patterns whenever the index is deleted. For this I am using the requests module in Python to send the delete request to the Kibana API enpoint. However, the request fails when I try to use the index pattern name but succeeds when I use the _id of the index pattern. Is there any way to use the index pattern name to delete the index patterns using the Kibana API?
You need the id to delete the index pattern, the name alone won't be enough. What you could do is to use the find api to look up the id: Find objects API | Kibana Guide [7.16] | Elastic , then call delete with the id
If you are also creating the index patterns programatically, you could make the id and the pattern identical to save this step
Thank you so much Joe. Yes, I am creating the index patterns programmatically so having the id be the same as the pattern name will help save a lot of work. Thanks a lot.
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.