<?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: Define a variable/constant in configuration/setup file for app in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Define-a-variable-constant-in-configuration-setup-file-for-app/m-p/86524#M22065</link>
    <description>&lt;P&gt;Hi Kristian,&lt;/P&gt;

&lt;P&gt;Well, this is an app that I want to fit several customers. Some want to have their own index name, others want the default&lt;/P&gt;

&lt;P&gt;All my searches specifically search in the default "ios" index. This "index=ios" string is defined in the saved searches and [ios] is defined in the indexes.conf file that I distribute with the app. Some users may want to put all logs in an index called i.e. "network" instead, and to accomodate their need I would like to define the index name one place.&lt;/P&gt;

&lt;P&gt;I could of course remove the whole index=ios search, but I want to specifically search in the right index&lt;/P&gt;</description>
    <pubDate>Sat, 06 Apr 2013 10:03:10 GMT</pubDate>
    <dc:creator>mikaelbje</dc:creator>
    <dc:date>2013-04-06T10:03:10Z</dc:date>
    <item>
      <title>Define a variable/constant in configuration/setup file for app</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Define-a-variable-constant-in-configuration-setup-file-for-app/m-p/86522#M22063</link>
      <description>&lt;P&gt;I am building a few apps and have users requesting an easy way to change the default index name the app searches through. Is there a way to define this variable/constant in just one place and use it in indexes.conf and all my saved searches so that users don't have to search and replace the default index=name in all the files? I figure using a macro I could achieve this, but the macro wouldn't expand in indexes.conf so that file would still have to be manually edited with the right index name.&lt;/P&gt;

&lt;P&gt;Something like a variables.conf/constants.conf file for each app would be excellent to set specific vars/constants to be reused in searches etc. for the scope of the app.&lt;/P&gt;</description>
      <pubDate>Sat, 06 Apr 2013 07:58:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Define-a-variable-constant-in-configuration-setup-file-for-app/m-p/86522#M22063</guid>
      <dc:creator>mikaelbje</dc:creator>
      <dc:date>2013-04-06T07:58:34Z</dc:date>
    </item>
    <item>
      <title>Re: Define a variable/constant in configuration/setup file for app</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Define-a-variable-constant-in-configuration-setup-file-for-app/m-p/86523#M22064</link>
      <description>&lt;P&gt;I don't think that you want to have users change indexes.conf, since that is where the indexes are defined (i.e. not related to how they are searched).&lt;/P&gt;</description>
      <pubDate>Sat, 06 Apr 2013 09:48:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Define-a-variable-constant-in-configuration-setup-file-for-app/m-p/86523#M22064</guid>
      <dc:creator>kristian_kolb</dc:creator>
      <dc:date>2013-04-06T09:48:03Z</dc:date>
    </item>
    <item>
      <title>Re: Define a variable/constant in configuration/setup file for app</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Define-a-variable-constant-in-configuration-setup-file-for-app/m-p/86524#M22065</link>
      <description>&lt;P&gt;Hi Kristian,&lt;/P&gt;

&lt;P&gt;Well, this is an app that I want to fit several customers. Some want to have their own index name, others want the default&lt;/P&gt;

&lt;P&gt;All my searches specifically search in the default "ios" index. This "index=ios" string is defined in the saved searches and [ios] is defined in the indexes.conf file that I distribute with the app. Some users may want to put all logs in an index called i.e. "network" instead, and to accomodate their need I would like to define the index name one place.&lt;/P&gt;

&lt;P&gt;I could of course remove the whole index=ios search, but I want to specifically search in the right index&lt;/P&gt;</description>
      <pubDate>Sat, 06 Apr 2013 10:03:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Define-a-variable-constant-in-configuration-setup-file-for-app/m-p/86524#M22065</guid>
      <dc:creator>mikaelbje</dc:creator>
      <dc:date>2013-04-06T10:03:10Z</dc:date>
    </item>
    <item>
      <title>Re: Define a variable/constant in configuration/setup file for app</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Define-a-variable-constant-in-configuration-setup-file-for-app/m-p/86525#M22066</link>
      <description>&lt;P&gt;Your app configuration UI can create and manage indexes through the REST API&lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/5.0.2/RESTAPI/RESTindex"&gt;http://docs.splunk.com/Documentation/Splunk/5.0.2/RESTAPI/RESTindex&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 06 Apr 2013 17:06:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Define-a-variable-constant-in-configuration-setup-file-for-app/m-p/86525#M22066</guid>
      <dc:creator>rsennett_splunk</dc:creator>
      <dc:date>2013-04-06T17:06:31Z</dc:date>
    </item>
    <item>
      <title>Re: Define a variable/constant in configuration/setup file for app</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Define-a-variable-constant-in-configuration-setup-file-for-app/m-p/86526#M22067</link>
      <description>&lt;P&gt;Sorry for my very late reply. Your suggestion is a viable option for an app that has a UI, but for a TA users still need to edit inputs.conf and transforms.conf to set the specific variable. If I could just reference that variable from these files that would solve it, but there is no place to set a variable like this. I.e. CISCO_IOS_INDEX=ios&lt;BR /&gt;
I'd then like to reference $CISCO_IOS_INDEX in inputs.conf and transforms.conf&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 14:59:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Define-a-variable-constant-in-configuration-setup-file-for-app/m-p/86526#M22067</guid>
      <dc:creator>mikaelbje</dc:creator>
      <dc:date>2020-09-28T14:59:11Z</dc:date>
    </item>
  </channel>
</rss>

