Getting Data In

How do you create and delete the indexers using shell or Python?

impsk
New Member

Hello,

I'm new to scripting can anyone please help me out to create and delete indexers using shell or Python?

I've gone through every document in Splunk for deleting/creating, but it's in CLI.

Much appreciated.

Tags (2)
0 Karma

nickhills
Ultra Champion

You can totally do this, but there is a huge amount to consider.

Creating and removing indexers should not be done lightly - depending on your configuration, there is huge potential to loose data irretrievably, and/or render your entire deployment unrecoverable.

With that said, if you are using S2, this becomes significantly more achievable, but the scale down process still needs a number of things to run first to roll off hot buckets to S2.

I suppose at this stage, its worth asking the question:
Is this for a test/dev/lab environment (where you don't care about the data) or is this Prod and you need to preserve the data?

If its the latter, I very strongly suggest you engage with Splunk PS and take their guidance, as there is a lot to think about.

If my comment helps, please give it a thumbs up!
0 Karma

impsk
New Member

Its right now for a test purpose .

for say : deleting the indexer from splunk below three steps should be prcoessed but as said earlier i'm new to scripting it would be grace if you can help me out with this:

#!/usr/bin/env bash
/opt/splunk/bin ./splunk stop
./splunk clean eventdata -index indexname
./splunk start

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 ...