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!

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...