Archive

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

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?

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

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
State of Splunk Careers

Access the Splunk Careers Report to see real data that shows how Splunk mastery increases your value and job satisfaction.

Find out what your skills are worth!