<?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: Efficient Lookup Table Search for each Field, Combine Results? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Efficient-Lookup-Table-Search-for-each-Field-Combine-Results/m-p/380635#M111376</link>
    <description>&lt;P&gt;Worked like a charm!&lt;/P&gt;</description>
    <pubDate>Thu, 03 May 2018 13:48:36 GMT</pubDate>
    <dc:creator>mlorrette</dc:creator>
    <dc:date>2018-05-03T13:48:36Z</dc:date>
    <item>
      <title>Efficient Lookup Table Search for each Field, Combine Results?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Efficient-Lookup-Table-Search-for-each-Field-Combine-Results/m-p/380629#M111370</link>
      <description>&lt;P&gt;I'd like to run a search for each host in a list but &lt;STRONG&gt;only return the top result for each host&lt;/STRONG&gt;.   In a search, it could look something like:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;host=Server-01 searchterms | head 1 | table interestingValue
| append
[ host=Server-02 searchterms | head 1 | table interestingValue]
| append
[ host=Server-nn searchterms | head 1 | table interestingValue]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I thought of creating a lookup table "Server_Names.csv" and somewhat loop through it?  Use a macro?  Unsure.  &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;hostName
Server-01
Server-02
Server-nn
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 02 May 2018 21:35:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Efficient-Lookup-Table-Search-for-each-Field-Combine-Results/m-p/380629#M111370</guid>
      <dc:creator>mlorrette</dc:creator>
      <dc:date>2018-05-02T21:35:05Z</dc:date>
    </item>
    <item>
      <title>Re: Efficient Lookup Table Search for each Field, Combine Results?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Efficient-Lookup-Table-Search-for-each-Field-Combine-Results/m-p/380630#M111371</link>
      <description>&lt;PRE&gt;host=Server-01 OR host=Server-01 OR host=Server-nn searchterms | dedup host | table host  interestingValue &lt;/PRE&gt;</description>
      <pubDate>Wed, 02 May 2018 21:57:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Efficient-Lookup-Table-Search-for-each-Field-Combine-Results/m-p/380630#M111371</guid>
      <dc:creator>pradeepkumarg</dc:creator>
      <dc:date>2018-05-02T21:57:02Z</dc:date>
    </item>
    <item>
      <title>Re: Efficient Lookup Table Search for each Field, Combine Results?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Efficient-Lookup-Table-Search-for-each-Field-Combine-Results/m-p/380631#M111372</link>
      <description>&lt;P&gt;Are &lt;CODE&gt;searchterms&lt;/CODE&gt; and &lt;CODE&gt;interestingValue&lt;/CODE&gt; the same for every host, or are they different each time?&lt;/P&gt;</description>
      <pubDate>Wed, 02 May 2018 22:08:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Efficient-Lookup-Table-Search-for-each-Field-Combine-Results/m-p/380631#M111372</guid>
      <dc:creator>xpac</dc:creator>
      <dc:date>2018-05-02T22:08:13Z</dc:date>
    </item>
    <item>
      <title>Re: Efficient Lookup Table Search for each Field, Combine Results?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Efficient-Lookup-Table-Search-for-each-Field-Combine-Results/m-p/380632#M111373</link>
      <description>&lt;P&gt;@xpac Yes- they &lt;CODE&gt;searchterms&lt;/CODE&gt; and &lt;CODE&gt;interestingValue&lt;/CODE&gt;  are the same.. are you thinking of a macro?&lt;/P&gt;</description>
      <pubDate>Thu, 03 May 2018 12:29:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Efficient-Lookup-Table-Search-for-each-Field-Combine-Results/m-p/380632#M111373</guid>
      <dc:creator>mlorrette</dc:creator>
      <dc:date>2018-05-03T12:29:01Z</dc:date>
    </item>
    <item>
      <title>Re: Efficient Lookup Table Search for each Field, Combine Results?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Efficient-Lookup-Table-Search-for-each-Field-Combine-Results/m-p/380633#M111374</link>
      <description>&lt;P&gt;Try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=whatever (host=Server-01 OR host=Server-02 OR ...) searchterms
| stats latest(interestingValue) by host
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Hope that helps - if it does I'd be happy if you would upvote/accept this answer, so others could profit from it. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 03 May 2018 12:51:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Efficient-Lookup-Table-Search-for-each-Field-Combine-Results/m-p/380633#M111374</guid>
      <dc:creator>xpac</dc:creator>
      <dc:date>2018-05-03T12:51:46Z</dc:date>
    </item>
    <item>
      <title>Re: Efficient Lookup Table Search for each Field, Combine Results?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Efficient-Lookup-Table-Search-for-each-Field-Combine-Results/m-p/380634#M111375</link>
      <description>&lt;P&gt;And then you could indeed put the host filter part into a macro for easier maintenance and reuse across searches. Or leave it out altogether if you want to look at all your hosts anyway.&lt;/P&gt;</description>
      <pubDate>Thu, 03 May 2018 13:38:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Efficient-Lookup-Table-Search-for-each-Field-Combine-Results/m-p/380634#M111375</guid>
      <dc:creator>FrankVl</dc:creator>
      <dc:date>2018-05-03T13:38:15Z</dc:date>
    </item>
    <item>
      <title>Re: Efficient Lookup Table Search for each Field, Combine Results?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Efficient-Lookup-Table-Search-for-each-Field-Combine-Results/m-p/380635#M111376</link>
      <description>&lt;P&gt;Worked like a charm!&lt;/P&gt;</description>
      <pubDate>Thu, 03 May 2018 13:48:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Efficient-Lookup-Table-Search-for-each-Field-Combine-Results/m-p/380635#M111376</guid>
      <dc:creator>mlorrette</dc:creator>
      <dc:date>2018-05-03T13:48:36Z</dc:date>
    </item>
    <item>
      <title>Re: Efficient Lookup Table Search for each Field, Combine Results?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Efficient-Lookup-Table-Search-for-each-Field-Combine-Results/m-p/380636#M111377</link>
      <description>&lt;P&gt;@xpac&lt;BR /&gt;
Upvoted.  I've added a lookup table:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=wineventlog sourcetype="WinEventLog:Security"
[| inputlookup serverList.csv | rename Name as host | fields host]
| dedup host | table host 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I now need to figure out how to display servers that are part of serverList.csv but don't appear in the search. Added a second lookup but it didn't work.  Separate question though..&lt;/P&gt;</description>
      <pubDate>Thu, 03 May 2018 15:56:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Efficient-Lookup-Table-Search-for-each-Field-Combine-Results/m-p/380636#M111377</guid>
      <dc:creator>mlorrette</dc:creator>
      <dc:date>2018-05-03T15:56:04Z</dc:date>
    </item>
  </channel>
</rss>

