<?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 Using value in lookup as source in search in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Using-value-in-lookup-as-source-in-search/m-p/483930#M135474</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;I am new to Splunk so apologies if this question seems overly simple.&lt;/P&gt;

&lt;P&gt;Currently I have a search where in the query I list off the different sources, e.g.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; index=my_index host=my_host (source=".../component_1.log" OR source=".../component_2.log" OR ... etc)  "keyword"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;However, requirements have changed and I now need to store that list of sources in a lookup file, which looks like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;source,
".../component_1.log"
".../component_2.log"
...
".../component_n.log"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Can I take the values stored in the lookup file and use them as a the source value in a subsequent search? It seems like something very easy but I just can't seem to get it right.&lt;/P&gt;

&lt;P&gt;I have added the lookup correctly to my splunk environment and can see its contents okay.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|inputlookup my_lookup.csv
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I just can't seem to combine the two elements, am I missing something basic?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|inputlookup my_lookup.csv | rename source as lookup_source | fields lookup_source | search index=my_index host=my_host source=lookup_source "keyword"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Thanks.&lt;/P&gt;</description>
    <pubDate>Fri, 28 Feb 2020 11:45:37 GMT</pubDate>
    <dc:creator>eoghanmcd</dc:creator>
    <dc:date>2020-02-28T11:45:37Z</dc:date>
    <item>
      <title>Using value in lookup as source in search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Using-value-in-lookup-as-source-in-search/m-p/483930#M135474</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;I am new to Splunk so apologies if this question seems overly simple.&lt;/P&gt;

&lt;P&gt;Currently I have a search where in the query I list off the different sources, e.g.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; index=my_index host=my_host (source=".../component_1.log" OR source=".../component_2.log" OR ... etc)  "keyword"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;However, requirements have changed and I now need to store that list of sources in a lookup file, which looks like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;source,
".../component_1.log"
".../component_2.log"
...
".../component_n.log"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Can I take the values stored in the lookup file and use them as a the source value in a subsequent search? It seems like something very easy but I just can't seem to get it right.&lt;/P&gt;

&lt;P&gt;I have added the lookup correctly to my splunk environment and can see its contents okay.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|inputlookup my_lookup.csv
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I just can't seem to combine the two elements, am I missing something basic?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|inputlookup my_lookup.csv | rename source as lookup_source | fields lookup_source | search index=my_index host=my_host source=lookup_source "keyword"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Fri, 28 Feb 2020 11:45:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Using-value-in-lookup-as-source-in-search/m-p/483930#M135474</guid>
      <dc:creator>eoghanmcd</dc:creator>
      <dc:date>2020-02-28T11:45:37Z</dc:date>
    </item>
    <item>
      <title>Re: Using value in lookup as source in search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Using-value-in-lookup-as-source-in-search/m-p/483931#M135475</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;index=my_index host=my_host  "keyword" [|inputlookup my_lookup.csv ]
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 28 Feb 2020 20:24:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Using-value-in-lookup-as-source-in-search/m-p/483931#M135475</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-02-28T20:24:41Z</dc:date>
    </item>
  </channel>
</rss>

