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
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!

Tech Talk Recap | Mastering Threat Hunting

Mastering Threat HuntingDive into the world of threat hunting, exploring the key differences between ...

Observability for AI Applications: Troubleshooting Latency

If you’re working with proprietary company data, you’re probably going to have a locally hosted LLM or many ...

Splunk AI Assistant for SPL vs. ChatGPT: Which One is Better?

In the age of AI, every tool promises to make our lives easier. From summarizing content to writing code, ...