<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: index_name variable to use in all index paths in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/index-name-variable-to-use-in-all-index-paths/m-p/117096#M31176</link>
    <description>&lt;P&gt;I'm guessing that thawedPath is a bit of the "odd one out" and may not play nice with $_index_name, but I don't know that for certain.&lt;/P&gt;</description>
    <pubDate>Mon, 28 Oct 2013 13:55:42 GMT</pubDate>
    <dc:creator>sowings</dc:creator>
    <dc:date>2013-10-28T13:55:42Z</dc:date>
    <item>
      <title>index_name variable to use in all index paths</title>
      <link>https://community.splunk.com/t5/Splunk-Search/index-name-variable-to-use-in-all-index-paths/m-p/117094#M31174</link>
      <description>&lt;P&gt;I'm looking for a variable that can be used to replace the index name for the following configs in the indexes.conf file:&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;homePath&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;
&lt;STRONG&gt;coldPath&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;
&lt;STRONG&gt;thawedPath&lt;/STRONG&gt;  &lt;/P&gt;

&lt;P&gt;I'm using volumes for my index paths, and in V6 I have found a variable called $_index_name which replaces the home &amp;amp; cold paths with the index name. This is how my global config now looks:&lt;/P&gt;

&lt;P&gt;coldPath = volume:cold/&lt;STRONG&gt;&lt;EM&gt;$_index_name&lt;/EM&gt;&lt;/STRONG&gt;/colddb&lt;BR /&gt;&lt;BR /&gt;
homePath = volume:hot/&lt;STRONG&gt;&lt;EM&gt;$_index_name&lt;/EM&gt;&lt;/STRONG&gt;/db&lt;/P&gt;

&lt;P&gt;This successfully replaces the index name, however, if I use this variable in the thawedPath, it won't resolve the variable and instead tries to create a folder called $_index_name, which fails as the different indexes try to use the same location.&lt;/P&gt;

&lt;P&gt;I'm trying to do this to allow me to standardise the index stanza's, as we have quite a lot of them.&lt;/P&gt;

&lt;P&gt;Does anyone know of a better way to do this?&lt;/P&gt;

&lt;P&gt;Thanks,&lt;BR /&gt;&lt;BR /&gt;
Ash&lt;/P&gt;</description>
      <pubDate>Mon, 28 Oct 2013 06:19:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/index-name-variable-to-use-in-all-index-paths/m-p/117094#M31174</guid>
      <dc:creator>ashleyherbert</dc:creator>
      <dc:date>2013-10-28T06:19:34Z</dc:date>
    </item>
    <item>
      <title>Re: index_name variable to use in all index paths</title>
      <link>https://community.splunk.com/t5/Splunk-Search/index-name-variable-to-use-in-all-index-paths/m-p/117095#M31175</link>
      <description>&lt;P&gt;Note that thawedPath needs an absolute path that does NOT contain a volume reference.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Oct 2013 12:45:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/index-name-variable-to-use-in-all-index-paths/m-p/117095#M31175</guid>
      <dc:creator>_d_</dc:creator>
      <dc:date>2013-10-28T12:45:05Z</dc:date>
    </item>
    <item>
      <title>Re: index_name variable to use in all index paths</title>
      <link>https://community.splunk.com/t5/Splunk-Search/index-name-variable-to-use-in-all-index-paths/m-p/117096#M31176</link>
      <description>&lt;P&gt;I'm guessing that thawedPath is a bit of the "odd one out" and may not play nice with $_index_name, but I don't know that for certain.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Oct 2013 13:55:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/index-name-variable-to-use-in-all-index-paths/m-p/117096#M31176</guid>
      <dc:creator>sowings</dc:creator>
      <dc:date>2013-10-28T13:55:42Z</dc:date>
    </item>
    <item>
      <title>Re: index_name variable to use in all index paths</title>
      <link>https://community.splunk.com/t5/Splunk-Search/index-name-variable-to-use-in-all-index-paths/m-p/117097#M31177</link>
      <description>&lt;P&gt;Thanks, yeah I'm aware that the thawedPath can't contain a volume reference. My issue is the variable name rather than the volume. I find it very strange that the $SPLUNK_DB variable resolves fine in the thawedPath, but not the $_index_name&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 15:06:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/index-name-variable-to-use-in-all-index-paths/m-p/117097#M31177</guid>
      <dc:creator>ashleyherbert</dc:creator>
      <dc:date>2020-09-28T15:06:49Z</dc:date>
    </item>
    <item>
      <title>Re: index_name variable to use in all index paths</title>
      <link>https://community.splunk.com/t5/Splunk-Search/index-name-variable-to-use-in-all-index-paths/m-p/117098#M31178</link>
      <description>&lt;P&gt;ever hear anything more about this?&lt;/P&gt;</description>
      <pubDate>Fri, 06 Dec 2013 16:08:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/index-name-variable-to-use-in-all-index-paths/m-p/117098#M31178</guid>
      <dc:creator>cramasta</dc:creator>
      <dc:date>2013-12-06T16:08:26Z</dc:date>
    </item>
    <item>
      <title>Re: index_name variable to use in all index paths</title>
      <link>https://community.splunk.com/t5/Splunk-Search/index-name-variable-to-use-in-all-index-paths/m-p/117099#M31179</link>
      <description>&lt;P&gt;I have the same thing happening with my thawed path - it is configured as:&lt;/P&gt;

&lt;P&gt;[my_index]&lt;BR /&gt;
homePath = volume_hot:/$_index_name/db&lt;BR /&gt;
coldPath = volume_cold:/$_index_name/colddb&lt;BR /&gt;
thawedPath = $SPLUNK_DB/$_index_name/thaweddb&lt;BR /&gt;
...&lt;/P&gt;

&lt;P&gt;The hot and cold work as intended, however the thawed db ends up in: /opt/splunk/var/lib/splunk/$_index_name/thaweddb&lt;/P&gt;

&lt;P&gt;I checked the docs for indexes.conf, and while it doesn't explicitly tell you to not use $_index_name for thawedDB path, it doesn't use it in the example (but it does for homePath/ coldPath). It says that  the thawedPath should contain an absolute path that contains the thawed (resurrected) databases for the index.&lt;/P&gt;

&lt;P&gt;Of note, it mentions:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;We strongly recommend that you avoid the use of environment variables in index paths, 
aside from the possible exception of SPLUNK_DB.  See homePath  for the complete rationale.
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;However, that warning is also mentioned for homePath and cold Path.&lt;/P&gt;

&lt;P&gt;For now, I'll stick to writing out the index name in the path. &lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 23:29:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/index-name-variable-to-use-in-all-index-paths/m-p/117099#M31179</guid>
      <dc:creator>spavin</dc:creator>
      <dc:date>2020-09-29T23:29:56Z</dc:date>
    </item>
  </channel>
</rss>

