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!

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...