<?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: Splunk Dynamic search using lookup in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Splunk-Dynamic-search-using-lookup/m-p/366969#M108247</link>
    <description>&lt;P&gt;To do this you should create a csv file which contains the header index&lt;BR /&gt;
e.g. index&lt;BR /&gt;
xyz&lt;BR /&gt;
xyz&lt;BR /&gt;
xzy&lt;/P&gt;

&lt;P&gt;exclude adding "index=" to the index value on the lookup. &lt;BR /&gt;
once this lookup is created use this search string&lt;/P&gt;

&lt;P&gt;[|inputlookup "your_lookup_name"&lt;BR /&gt;
| search index=*&lt;BR /&gt;
| eval search="(index=".index.") OR" &lt;BR /&gt;
| stats values(search) as search &lt;BR /&gt;
| eval search=tostring(search) &lt;BR /&gt;
| eval search=substr(search,0,len(search)-3)]&lt;/P&gt;

&lt;P&gt;this will then amalgamate the different indexes and run it!&lt;/P&gt;</description>
    <pubDate>Tue, 29 Sep 2020 22:36:50 GMT</pubDate>
    <dc:creator>Eshaac</dc:creator>
    <dc:date>2020-09-29T22:36:50Z</dc:date>
    <item>
      <title>Splunk Dynamic search using lookup</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-Dynamic-search-using-lookup/m-p/366965#M108243</link>
      <description>&lt;P&gt;I wish to populate a list of index names ( &amp;gt; 1) from a lookup table to a search query. &lt;/P&gt;

&lt;P&gt;Indexlookup.csv --&amp;gt; &lt;/P&gt;

&lt;P&gt;COL1&lt;/P&gt;

&lt;HR /&gt;

&lt;P&gt;index1&lt;BR /&gt;
index2&lt;BR /&gt;
index5&lt;BR /&gt;
index9&lt;/P&gt;

&lt;P&gt;search --&amp;gt;&lt;/P&gt;

&lt;P&gt;query | search index="index1" OR index="index2" OR index="index5" OR index="index1" | .........................&lt;/P&gt;</description>
      <pubDate>Mon, 08 May 2017 08:33:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-Dynamic-search-using-lookup/m-p/366965#M108243</guid>
      <dc:creator>rishiaggarwal</dc:creator>
      <dc:date>2017-05-08T08:33:01Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk Dynamic search using lookup</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-Dynamic-search-using-lookup/m-p/366966#M108244</link>
      <description>&lt;P&gt;Hi  rishiaggarwal,&lt;BR /&gt;
to do this, you have to put your indexes in a lookup with column name called index and use it in a subsearch&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your_search [ | inputlookup your_indexes.csv | fields index ] | ...
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I don't like this solution, I prefer to put indexes in an eventtype and use it in my searches.&lt;/P&gt;

&lt;P&gt;Bye.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Mon, 08 May 2017 09:34:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-Dynamic-search-using-lookup/m-p/366966#M108244</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2017-05-08T09:34:10Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk Dynamic search using lookup</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-Dynamic-search-using-lookup/m-p/366967#M108245</link>
      <description>&lt;P&gt;Try this way -&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;query | search [ | inputlookup Indexlookup.csv | rename COL1 as index | table index ] | ...
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;OR  &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;query | search [ | inputlookup Indexlookup.csv | rename COL1 as index | table index | format ] | ...
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 08 May 2017 10:04:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-Dynamic-search-using-lookup/m-p/366967#M108245</guid>
      <dc:creator>dineshraj9</dc:creator>
      <dc:date>2017-05-08T10:04:23Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk Dynamic search using lookup</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-Dynamic-search-using-lookup/m-p/366968#M108246</link>
      <description>&lt;P&gt;I am not sure what you imply by " index names ( &amp;gt; 1) ", however, instead of using the search you have mentioned you can try the following:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;YourBaseSearch&amp;gt; [|inputlookup Indexlookup.csv | rename COL1 as index| table index]
| &amp;lt;Your Remaining Search&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 08 May 2017 10:05:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-Dynamic-search-using-lookup/m-p/366968#M108246</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2017-05-08T10:05:31Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk Dynamic search using lookup</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-Dynamic-search-using-lookup/m-p/366969#M108247</link>
      <description>&lt;P&gt;To do this you should create a csv file which contains the header index&lt;BR /&gt;
e.g. index&lt;BR /&gt;
xyz&lt;BR /&gt;
xyz&lt;BR /&gt;
xzy&lt;/P&gt;

&lt;P&gt;exclude adding "index=" to the index value on the lookup. &lt;BR /&gt;
once this lookup is created use this search string&lt;/P&gt;

&lt;P&gt;[|inputlookup "your_lookup_name"&lt;BR /&gt;
| search index=*&lt;BR /&gt;
| eval search="(index=".index.") OR" &lt;BR /&gt;
| stats values(search) as search &lt;BR /&gt;
| eval search=tostring(search) &lt;BR /&gt;
| eval search=substr(search,0,len(search)-3)]&lt;/P&gt;

&lt;P&gt;this will then amalgamate the different indexes and run it!&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 22:36:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-Dynamic-search-using-lookup/m-p/366969#M108247</guid>
      <dc:creator>Eshaac</dc:creator>
      <dc:date>2020-09-29T22:36:50Z</dc:date>
    </item>
  </channel>
</rss>

