Deployment Architecture

Remove excess buckets via REST API

danman06
Explorer

We have some problems with excess buckets from time to time, and I am writing a python program to check for excess buckets. Then, I want to take that list and purge them. In the documentation, I see the endpoint /cluster/master/control/control/prune_index. My question is, is this the correct API end point to call? Do I need to pass it a list of buckets? Or am I off track?

0 Karma

jiaqya
Builder

how to avoid using user:pass if possible ?

0 Karma

harsmarvania57
SplunkTrust
SplunkTrust

Hi @danman06,

Yes, that is correct. REST API endpoint for removing excess buckets. Based on the documentation, if you want to remove excess buckets from certain indexes, you need to supply index name in that REST API. If you do not provide any index name, Splunk will remove excess buckets from all indexes.

index   Optional. The index from which to remove excess bucket copies. If not specified, the POST operation clears excess bucket copies across all indexes.

With Index name

curl -k -u admin:pass https://localhost:8089/services/cluster/master/control/control/prune_index -d index="my_index"

Without index (Which means it will remove excess bucket from all indexes)

curl -k -u admin:pass https://localhost:8089/services/cluster/master/control/control/prune_index

danman06
Explorer

Excellent, I'll do some testing and thanks for the prompt reply.

0 Karma
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...