<?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: How to limit the results of one lookup with a second lookup? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-limit-the-results-of-one-lookup-with-a-second-lookup/m-p/610497#M212317</link>
    <description>&lt;P&gt;I had a feeling I was overcomplicating it - thank you so much!&lt;/P&gt;</description>
    <pubDate>Tue, 23 Aug 2022 14:04:40 GMT</pubDate>
    <dc:creator>mistydennis</dc:creator>
    <dc:date>2022-08-23T14:04:40Z</dc:date>
    <item>
      <title>How to limit the results of one lookup with a second lookup?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-limit-the-results-of-one-lookup-with-a-second-lookup/m-p/610385#M212256</link>
      <description>&lt;P&gt;Hi all - I am trying to take one lookup and limit its results with another lookup.&amp;nbsp; I can kinda get it to work with my current SPL, but it's taking a long time to run and the results don't come out as expected. Here's what I have so far:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;| inputlookup my_kvstore 
| lookup my_lookup lookupfield_1 AS kvstorefield_1 OUTPUT lookupfield_1 
| lookup my_kvstore kvstorefield_1 AS lookupfield_1 OUTPUT kvstorefield_2, kvstorefield_3, kvstorefield_4, kvstorefield_5 
| WHERE kvstorefield_1=lookupfield_1&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Results:&lt;/P&gt;
&lt;TABLE border="1" width="100%"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="16.666666666666668%" height="25px"&gt;kvstorefield_1&lt;/TD&gt;
&lt;TD width="16.666666666666668%" height="25px"&gt;kvstorefield_2&lt;/TD&gt;
&lt;TD width="16.666666666666668%" height="25px"&gt;kvstorefield_3&lt;/TD&gt;
&lt;TD width="16.666666666666668%" height="25px"&gt;kvstorefield_4&lt;/TD&gt;
&lt;TD width="16.666666666666668%" height="25px"&gt;kvstorefield_5&lt;/TD&gt;
&lt;TD width="16.666666666666668%" height="25px"&gt;lookupfield_1&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="16.666666666666668%"&gt;
&lt;P&gt;2016&lt;/P&gt;
&lt;P&gt;2016&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="16.666666666666668%"&gt;
&lt;P&gt;centos&lt;/P&gt;
&lt;P&gt;centos&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="16.666666666666668%"&gt;
&lt;P&gt;linux&lt;/P&gt;
&lt;P&gt;linux&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="16.666666666666668%"&gt;
&lt;P&gt;web&lt;/P&gt;
&lt;P&gt;web&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="16.666666666666668%"&gt;
&lt;P&gt;workstation1&lt;/P&gt;
&lt;P&gt;workstation2&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="16.666666666666668%"&gt;
&lt;P&gt;2016&lt;/P&gt;
&lt;P&gt;2016&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="16.666666666666668%" height="112px"&gt;
&lt;P&gt;2017&lt;/P&gt;
&lt;P&gt;2017&lt;/P&gt;
&lt;P&gt;2017&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="16.666666666666668%" height="112px"&gt;
&lt;P&gt;apache&lt;/P&gt;
&lt;P&gt;apache&lt;/P&gt;
&lt;P&gt;apache&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="16.666666666666668%" height="112px"&gt;
&lt;P&gt;tomcat&lt;/P&gt;
&lt;P&gt;tomcat&lt;/P&gt;
&lt;P&gt;tomcat&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="16.666666666666668%" height="112px"&gt;
&lt;P&gt;http&lt;/P&gt;
&lt;P&gt;http&lt;/P&gt;
&lt;P&gt;http&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="16.666666666666668%" height="112px"&gt;
&lt;P&gt;server1&lt;/P&gt;
&lt;P&gt;server2&lt;/P&gt;
&lt;P&gt;server3&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="16.666666666666668%" height="112px"&gt;
&lt;P&gt;2017&lt;/P&gt;
&lt;P&gt;2017&lt;/P&gt;
&lt;P&gt;2017&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1. Is my search formed correctly?&amp;nbsp;&lt;BR /&gt;2. How do I get each of the events to come out in their own row instead of being grouped into one line based on the matching kvstorefield/lookupfield?&lt;/P&gt;</description>
      <pubDate>Mon, 22 Aug 2022 20:52:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-limit-the-results-of-one-lookup-with-a-second-lookup/m-p/610385#M212256</guid>
      <dc:creator>mistydennis</dc:creator>
      <dc:date>2022-08-22T20:52:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to limit the results of one lookup with a second lookup?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-limit-the-results-of-one-lookup-with-a-second-lookup/m-p/610403#M212264</link>
      <description>&lt;P&gt;If I understand the example correctly, kv store lookup contains data set 1 and you want to only select rows where a row also exists in your second lookup.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Seems to me that you already have&amp;nbsp;kvstorefield_ fields 2-5 from the inputlookup on your first line, so the lookup on line 2 will simply validate if it contains&amp;nbsp;kvstorefield_1. I believe your line 3 and 4 can just be replaced with&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| where isnotnull(lookupfield_1)&lt;/LI-CODE&gt;&lt;P&gt;which will say 'if&amp;nbsp;kvstorefield_1 is NOT in lookup, then ignore'.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 22 Aug 2022 23:18:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-limit-the-results-of-one-lookup-with-a-second-lookup/m-p/610403#M212264</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2022-08-22T23:18:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to limit the results of one lookup with a second lookup?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-limit-the-results-of-one-lookup-with-a-second-lookup/m-p/610404#M212265</link>
      <description>&lt;P&gt;not sure what your second lookup is containing, but if you have multiple matches for the lookup field (2016/2017), then you will get multiple results in the same row, so when you re-lookup the data, it will create multiple values in the final table.&lt;/P&gt;&lt;P&gt;If you remove the second lookup, which appears unnecessary, then your result should look better.&lt;/P&gt;</description>
      <pubDate>Mon, 22 Aug 2022 23:25:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-limit-the-results-of-one-lookup-with-a-second-lookup/m-p/610404#M212265</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2022-08-22T23:25:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to limit the results of one lookup with a second lookup?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-limit-the-results-of-one-lookup-with-a-second-lookup/m-p/610497#M212317</link>
      <description>&lt;P&gt;I had a feeling I was overcomplicating it - thank you so much!&lt;/P&gt;</description>
      <pubDate>Tue, 23 Aug 2022 14:04:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-limit-the-results-of-one-lookup-with-a-second-lookup/m-p/610497#M212317</guid>
      <dc:creator>mistydennis</dc:creator>
      <dc:date>2022-08-23T14:04:40Z</dc:date>
    </item>
  </channel>
</rss>

