Archive

How do I set the default index?

Champion

I've created a custom index that I want to be my new defaultdb. Currently, my defaultdb is "main" index. I want all events without an index specified to be funneled to my new custom db. How do I do this?

1 Solution

Champion

Out-of-the-box, defaultdb is set to main. To change this, edit your indexes.conf file to reflect the new default index. If you have a new index called "badger", set the following at the top (global setting):

defaultDatabase = badger

From indexes.conf.spec:

defaultDatabase = <database name>
* If no index is specified during search, Splunk searches default database. 
* Also the database displays by default on the homepage.
* Defaults to main.

View solution in original post

New Member

You can do this by going to roles in the GUI under users and authentication (Version 8.0.1). Then find the role for the group of users and click the indexes tab. Under there you will see a default column you can check to set the default index(s).

0 Karma

Splunk Employee
Splunk Employee

Even if you change the default index as per the above instructions, this wouldn't be the 'default' index, until you granted access by adding the index to 'Indexes searched by default' under Manager » Access controls » Roles » . After that point, it would be searched by default, as smisplunk indicates above.

Champion

The default index above refers specifically to which index data is funneled to when an index is not specified for the datasource. But you are correct that there is a separate configuration that would need to be modified for searching if you want that index to also be the default SEARCH index.

0 Karma

Path Finder

If you meant the "default" index in terms of which index(es) are searched if no "index=" clause is provided in the search string, that can be done on a per-user basis from the manager (it sets srchIndexesDefault values in authorize.conf for the given role).

Champion

Out-of-the-box, defaultdb is set to main. To change this, edit your indexes.conf file to reflect the new default index. If you have a new index called "badger", set the following at the top (global setting):

defaultDatabase = badger

From indexes.conf.spec:

defaultDatabase = <database name>
* If no index is specified during search, Splunk searches default database. 
* Also the database displays by default on the homepage.
* Defaults to main.

View solution in original post

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!