Getting Data In

Rename an index

smudge797
Path Finder

Is it possible to rename an index in the same way sourcetype and source can be renamed with props and transforms.

0 Karma

inventsekar
Ultra Champion

from a similar post - You can't really rename an index, but you can create a new index with the name you want (via indexes.conf/GUI) and move the data from the old index to the new index.

You would need to stop Splunk, then move the $SPLUNK_DB/ directory to $SPLUNK_DB/ and then start Splunk. That should be all you'd need to do to get the data in the new index. Keep in mind any searches that reference the other index will need to be changed.

http://docs.splunk.com/Documentation/Splunk/6.1.4/Indexer/Moveanindex

0 Karma

javiergn
SplunkTrust
SplunkTrust

Assuming your data is not cooked yet (it hasn't gone through a Heavy Forwarder already for instance) you can do this in your indexer or in a heavy forwarder:

transforms.conf

[renameindex]
REGEX = .
DEST_KEY = _MetaData:Index
FORMAT = newindexname

props.conf

 [sourcetype, host or source stanza]
 TRANSFORMS-index = renameindex

See this: http://docs.splunk.com/Documentation/Splunk/6.6.1/Admin/Transformsconf#KEYS:

0 Karma
Get Updates on the Splunk Community!

Welcome to the Splunk Community!

(view in My Videos) We're so glad you're here! The Splunk Community is place to connect, learn, give back, and ...

Tech Talk | Elevating Digital Service Excellence: The Synergy of Splunk RUM & APM

Elevating Digital Service Excellence: The Synergy of Real User Monitoring and Application Performance ...

Adoption of RUM and APM at Splunk

    Unleash the power of Splunk Observability   Watch Now In this can't miss Tech Talk! The Splunk Growth ...