Getting Data In

Is there a way to set the default in indexes.conf for a value?

daniel333
Builder

All,

I am rewriting my indexes.conf file. It had gotten pretty ugly over the years. I find myself writing the same values over and over again. Is there anyway to declare defaults?

For example, the paths and the frozenTimePeriodInSecs specifically?

[os]
repFactor=0
homePath = volume:splunksilver/os/db
coldPath = volume:splunksilver/os/colddb
thawedPath = $SPLUNK_DB/os/thaweddb
frozenTimePeriodInSecs = 2419200

[java]

Is a passive data center largely. Setting to 28 days retention

repFactor=0
homePath = volume:splunksilver/java/db
coldPath = volume:splunksilver/java/colddb
thawedPath = $SPLUNK_DB/java/thaweddb
frozenTimePeriodInSecs = 2419200

0 Karma
1 Solution

acharlieh
Influencer

Yes there is! If you put values outside any stanza they will apply to all unless overridden within a specific stanza. See the top of: https://docs.splunk.com/Documentation/Splunk/6.5.2/Admin/Indexesconf

```

GLOBAL SETTINGS

Use the [default] stanza to define any global settings.

* You can also define global settings outside of any stanza, at the top

of the file.

* Each conf file should have at most one default stanza. If there are

multiple default stanzas, attributes are combined. In the case of

multiple definitions of the same attribute, the last definition in the

file wins.

* If an attribute is defined at both the global level and in a specific

stanza, the value in the specific stanza takes precedence.

```

View solution in original post

0 Karma

acharlieh
Influencer

Yes there is! If you put values outside any stanza they will apply to all unless overridden within a specific stanza. See the top of: https://docs.splunk.com/Documentation/Splunk/6.5.2/Admin/Indexesconf

```

GLOBAL SETTINGS

Use the [default] stanza to define any global settings.

* You can also define global settings outside of any stanza, at the top

of the file.

* Each conf file should have at most one default stanza. If there are

multiple default stanzas, attributes are combined. In the case of

multiple definitions of the same attribute, the last definition in the

file wins.

* If an attribute is defined at both the global level and in a specific

stanza, the value in the specific stanza takes precedence.

```

0 Karma

acharlieh
Influencer

Actually I should also add a note, that resolution of default values from the default stanza is done after the merging of all the configuration files from all apps as described in http://docs.splunk.com/Documentation/Splunk/6.5.2/Admin/Wheretofindtheconfigurationfiles

(Which with indexes the way that could bite you is that some of the shipped indexes.conf have specific stanza level settings in X/default/indexes.conf that would take precedence over default stanza setting in X/local/indexes.conf )

In short remember btool is your friend: https://docs.splunk.com/Documentation/Splunk/6.5.2/Troubleshooting/Usebtooltotroubleshootconfigurati...

Get Updates on the Splunk Community!

Splunk + ThousandEyes: Correlate frontend, app, and network data to troubleshoot ...

 Are you tired of troubleshooting delays caused by siloed frontend, application, and network data? We've got a ...

Splunk Observability for AI

Don’t miss out on an exciting Tech Talk on Splunk Observability for AI!Discover how Splunk’s agentic AI ...

🔐 Trust at Every Hop: How mTLS in Splunk Enterprise 10.0 Makes Security Simpler

From Idea to Implementation: Why Splunk Built mTLS into Splunk Enterprise 10.0  mTLS wasn’t just a checkbox ...