Getting Data In

Can I manually rename an index homePath with existing data?

joshuapetitt
Path Finder

Hi all,

I'm dealing with a legacy Splunk installation where I'd like to clean up an index for consistency.

Lets say I have an index called 'mydata'.  This index is active and has events indexed there fairly regularly (i.e. many times a minute)

Previously, this index was defined manually in /opt/splunk/etc/system/local/indexes.conf.

The home path was specified as /opt/splunk/var/lib/splunk/mydatadb/db'.  (NOTE: the folder 'mydatadb' in the path)

Most of our other indexes use the notation of having the home path folder the same name as the index.  I would like to migrate this existing index to use this pattern.

Can I simply update indexes.conf to use '/opt/splunk/var/lib/splunk/mydata/db' then manually rename the folder in the filesystem, and restart the indexer?

Is there any metadata or anything else in the db that would cause this path change to break the indexed data?

 

Labels (1)
0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @joshuapetitt,

if you would move an index from a location to another one, as you can read at https://docs.splunk.com/Documentation/Splunk/8.0.5/Indexer/Moveanindex , you can move an index following this approach:

  • stop Splunk,
  • change indexes.conf where i defined the index,
  • move the intere folder in the new location,
  • restart Splunk.

If instead you want to change the Index name (and folder) I'm not sure that's possible and the best approach could be:

  • create the new index,
  • stop the ingesting flow,
  • move the ingesting flow to the new index,
  • export all the old events from the old one and reindex them,
  • enable the ingesting flow.

Ciao.

Giuseppe

Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.
Get Updates on the Splunk Community!

Introduction to Splunk AI

How are you using AI in Splunk? Whether you see AI as a threat or opportunity, AI is here to stay. Lucky for ...

Splunk + ThousandEyes: Correlate frontend, app, and network data to troubleshoot ...

Are you tired of troubleshooting delays caused by siloed frontend, application, and network data? We've got a ...

Maximizing the Value of Splunk ES 8.x

Splunk Enterprise Security (ES) continues to be a leader in the Gartner Magic Quadrant, reflecting its pivotal ...