<?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,sourcetype as parameter in search in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Index-sourcetype-as-parameter-in-search/m-p/73867#M181131</link>
    <description>&lt;P&gt;Thanks.This seems to be a gud idea. &lt;BR /&gt;
I was wondering can inputs.config help us in this requirement?&lt;/P&gt;</description>
    <pubDate>Fri, 28 Dec 2012 11:12:33 GMT</pubDate>
    <dc:creator>splunk_learner</dc:creator>
    <dc:date>2012-12-28T11:12:33Z</dc:date>
    <item>
      <title>Index,sourcetype as parameter in search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Index-sourcetype-as-parameter-in-search/m-p/73865#M181129</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;
I want search query to read my index name and sourcetype name from config file.So that if there is any change in future,i dont have to edit all of the searches for a particular app.Is there any way to pass parameter from config file to search query for an particular app only.&lt;/P&gt;</description>
      <pubDate>Fri, 28 Dec 2012 11:03:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Index-sourcetype-as-parameter-in-search/m-p/73865#M181129</guid>
      <dc:creator>splunk_learner</dc:creator>
      <dc:date>2012-12-28T11:03:41Z</dc:date>
    </item>
    <item>
      <title>Re: Index,sourcetype as parameter in search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Index-sourcetype-as-parameter-in-search/m-p/73866#M181130</link>
      <description>&lt;P&gt;The usual way to do this is to create a macro called something like &lt;CODE&gt;get_index_name&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Then have the macro return the name of the index.&lt;/P&gt;

&lt;P&gt;i.e. the macro would be defined as :&lt;/P&gt;

&lt;P&gt;"index=my_index"&lt;/P&gt;

&lt;P&gt;Then all your searches in the app start with&lt;/P&gt;

&lt;P&gt;`&lt;CODE&gt;get_index_name&lt;/CODE&gt;`&lt;/P&gt;

&lt;P&gt;When you need to update the name of the index, you just alter the definition of the macro in one place and you're set.&lt;/P&gt;</description>
      <pubDate>Fri, 28 Dec 2012 11:09:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Index-sourcetype-as-parameter-in-search/m-p/73866#M181130</guid>
      <dc:creator>jonuwz</dc:creator>
      <dc:date>2012-12-28T11:09:15Z</dc:date>
    </item>
    <item>
      <title>Re: Index,sourcetype as parameter in search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Index-sourcetype-as-parameter-in-search/m-p/73867#M181131</link>
      <description>&lt;P&gt;Thanks.This seems to be a gud idea. &lt;BR /&gt;
I was wondering can inputs.config help us in this requirement?&lt;/P&gt;</description>
      <pubDate>Fri, 28 Dec 2012 11:12:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Index-sourcetype-as-parameter-in-search/m-p/73867#M181131</guid>
      <dc:creator>splunk_learner</dc:creator>
      <dc:date>2012-12-28T11:12:33Z</dc:date>
    </item>
    <item>
      <title>Re: Index,sourcetype as parameter in search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Index-sourcetype-as-parameter-in-search/m-p/73868#M181132</link>
      <description>&lt;P&gt;I don't think so. Inputs.conf determines where splunk gets data from, it doesn't set variables.&lt;/P&gt;

&lt;P&gt;Also - this isn't my idea, Its just i've noticed that this is how some of the most popular apps on splunk-base tackle the problem&lt;/P&gt;</description>
      <pubDate>Fri, 28 Dec 2012 11:40:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Index-sourcetype-as-parameter-in-search/m-p/73868#M181132</guid>
      <dc:creator>jonuwz</dc:creator>
      <dc:date>2012-12-28T11:40:21Z</dc:date>
    </item>
  </channel>
</rss>

