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!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...