Splunk Search

How to specify the path of a custom Database, while creating an index using command line

ajay_hbo
Engager

Hi I am trying to create an index on the command line as follows (splunk 4.1.4) ./bin/splunk add index indexname -dir $SPLUNK_DB/indexdb

But for some reason, splunk 4.1.4 fails to recognize "-dir". Does any one know if there is another way of specifying the name of my custom splunk DB, at the command line?

Genti
Splunk Employee
Splunk Employee

Doc Bug filed. Here is the correct command to add an index:

./splunk add index foo -homePath /your/path/foo/db -coldPath /your/path/foo/colddb -thawedPath /your/path/foo/thawedDb

Genti
Splunk Employee
Splunk Employee

from the docs:

    To use Splunk's CLI, navigate to the $SPLUNK_HOME/bin/ directory and

use the ./splunk command.

Important: You must stop Splunk before you edit the properties of an

existing index. You do not need to stop Splunk to create a new index.

To add or edit a new index called "fflanda" using the CLI:

./splunk [add|edit] index fflanda

You can also specify a value for any option in indexes.conf by passing

it as a flag (for example, -dir) to the [add|edit] index command.

You must restart Splunk when you create a new index or edit the

properties of an existing index.

The command fails with the following error:

An error occurred:
 Argument "dir" is not supported by this handler.

Will probably file a doc bug tomorrow and try to find the way its supposed to work..

0 Karma
Get Updates on the Splunk Community!

Updated Data Type Articles, Anniversary Celebrations, and More on Splunk Lantern

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

A Prelude to .conf25: Your Guide to Splunk University

Heading to Boston this September for .conf25? Get a jumpstart by arriving a few days early for Splunk ...

4 Ways the Splunk Community Helps You Prepare for .conf25

.conf25 is right around the corner, and whether you’re a first-time attendee or a seasoned Splunker, the ...