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
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Best Practices: Splunk auto adjust pipeline queue

When you enable autoAdjustQueue in Splunk, maxSize should be understood as the queue size Splunk starts with ...

Laser Bananas and Edge Hubs: Exploring Operational Technology (OT) Data Through a ...

  OT is a different environment to traditional IT and can have interesting challenges when interfacing the ...

Event Series: Mastering AI Tokenomics and Splunk Agent Observability

Beyond the Black Box: Correlating AI Performance and Tokenomics with Splunk Agent Observability   As ...