<?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: Search Items in a Lookup Table NOT present in Index in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-Items-in-a-Lookup-Table-NOT-present-in-Index/m-p/120349#M32315</link>
    <description>&lt;P&gt;It looks nearly identical to what I posted.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| inputlookup folders | fields "Item ID", Path | search NOT [search index=folderevents | dedup event_id | table source.item_id | format]
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 01 Apr 2015 16:08:12 GMT</pubDate>
    <dc:creator>djn12313</dc:creator>
    <dc:date>2015-04-01T16:08:12Z</dc:date>
    <item>
      <title>How to search Items in a Lookup Table NOT present in Index?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-Items-in-a-Lookup-Table-NOT-present-in-Index/m-p/120347#M32313</link>
      <description>&lt;P&gt;Hi all -&lt;/P&gt;
&lt;P&gt;Relatively new to Splunk and have already attempted a number of methods from forums to perform this search to no avail.&lt;/P&gt;
&lt;P&gt;I have a single Index of events and a single lookup table containing reference data. Events are tied to the Lookup Table via the source.item_id value in the event stream and the lookup_id field in the Lookup Table. I'm trying to find items that exist in the Lookup table that do NOT exist in the event stream and then list the lookup_output field (from the Lookup Table) .&lt;/P&gt;
&lt;P&gt;The cleanest method seems to be something along these lines:&lt;/P&gt;
&lt;P&gt;&lt;CODE&gt;| inputlookup mtylookuptable | fields lookup_id, lookup_output | search NOT [search index=myindex | dedup event_id | table source.item_id | format]&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;Running each search independently seems to return the correct results. I opted to use "format" command to return a 'clean' list of the of source_item_ids.&lt;/P&gt;
&lt;P&gt;The problem I'm running into is the results returned are always &lt;EM&gt;every&lt;/EM&gt; value in the Lookup Table. Which I know is not right. Any thoughts / help appreciated.&lt;/P&gt;</description>
      <pubDate>Fri, 05 Aug 2022 14:21:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-Items-in-a-Lookup-Table-NOT-present-in-Index/m-p/120347#M32313</guid>
      <dc:creator>djn12313</dc:creator>
      <dc:date>2022-08-05T14:21:59Z</dc:date>
    </item>
    <item>
      <title>Re: Search Items in a Lookup Table NOT present in Index</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-Items-in-a-Lookup-Table-NOT-present-in-Index/m-p/120348#M32314</link>
      <description>&lt;P&gt;Can you tell us the field names you are using in both your base search and the lookup table? Or post the actual search?&lt;/P&gt;</description>
      <pubDate>Wed, 01 Apr 2015 15:08:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-Items-in-a-Lookup-Table-NOT-present-in-Index/m-p/120348#M32314</guid>
      <dc:creator>masonmorales</dc:creator>
      <dc:date>2015-04-01T15:08:20Z</dc:date>
    </item>
    <item>
      <title>Re: Search Items in a Lookup Table NOT present in Index</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-Items-in-a-Lookup-Table-NOT-present-in-Index/m-p/120349#M32315</link>
      <description>&lt;P&gt;It looks nearly identical to what I posted.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| inputlookup folders | fields "Item ID", Path | search NOT [search index=folderevents | dedup event_id | table source.item_id | format]
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 01 Apr 2015 16:08:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-Items-in-a-Lookup-Table-NOT-present-in-Index/m-p/120349#M32315</guid>
      <dc:creator>djn12313</dc:creator>
      <dc:date>2015-04-01T16:08:12Z</dc:date>
    </item>
    <item>
      <title>Re: Search Items in a Lookup Table NOT present in Index</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-Items-in-a-Lookup-Table-NOT-present-in-Index/m-p/120350#M32316</link>
      <description>&lt;P&gt;Without seeing your data, I don't know which fields are supposed to match up, but I am guessing you aren't getting the expect results because your field names between the inputlookup and your data do not match.&lt;/P&gt;</description>
      <pubDate>Wed, 01 Apr 2015 16:16:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-Items-in-a-Lookup-Table-NOT-present-in-Index/m-p/120350#M32316</guid>
      <dc:creator>masonmorales</dc:creator>
      <dc:date>2015-04-01T16:16:44Z</dc:date>
    </item>
    <item>
      <title>Re: Search Items in a Lookup Table NOT present in Index</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-Items-in-a-Lookup-Table-NOT-present-in-Index/m-p/120351#M32317</link>
      <description>&lt;P&gt;Try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| inputlookup folders | fields "Item ID", Path | search NOT [search index=folderevents | dedup event_id | table source.item_id  | rename source.item_id as "Item ID"| format]
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 01 Apr 2015 17:25:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-Items-in-a-Lookup-Table-NOT-present-in-Index/m-p/120351#M32317</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2015-04-01T17:25:58Z</dc:date>
    </item>
    <item>
      <title>Re: Search Items in a Lookup Table NOT present in Index</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-Items-in-a-Lookup-Table-NOT-present-in-Index/m-p/120352#M32318</link>
      <description>&lt;P&gt;Renaming the "Item ID" (what I also referred to in the original post as "lookup_id") to source.item_id ended up resolving this for me. &lt;/P&gt;

&lt;P&gt;Revised search looks like: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; | inputlookup folders | fields "Item ID", Path |  rename "Item ID" as source.item_id | search NOT [search index=folderevents | dedup event_id | table source.item_id | format]
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 28 Sep 2020 19:22:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-Items-in-a-Lookup-Table-NOT-present-in-Index/m-p/120352#M32318</guid>
      <dc:creator>djn12313</dc:creator>
      <dc:date>2020-09-28T19:22:31Z</dc:date>
    </item>
    <item>
      <title>Re: Search Items in a Lookup Table NOT present in Index</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-Items-in-a-Lookup-Table-NOT-present-in-Index/m-p/120353#M32319</link>
      <description>&lt;P&gt;It's strange. I tried renaming the field in the sub search first and couldn't get it to work. For some reason, however, it did work when I changed it in the inputlookup search per my comment above.&lt;/P&gt;</description>
      <pubDate>Wed, 01 Apr 2015 18:38:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-Items-in-a-Lookup-Table-NOT-present-in-Index/m-p/120353#M32319</guid>
      <dc:creator>djn12313</dc:creator>
      <dc:date>2015-04-01T18:38:54Z</dc:date>
    </item>
    <item>
      <title>Re: Search Items in a Lookup Table NOT present in Index</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-Items-in-a-Lookup-Table-NOT-present-in-Index/m-p/120354#M32320</link>
      <description>&lt;P&gt;Good to hear!&lt;/P&gt;</description>
      <pubDate>Wed, 01 Apr 2015 19:33:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-Items-in-a-Lookup-Table-NOT-present-in-Index/m-p/120354#M32320</guid>
      <dc:creator>masonmorales</dc:creator>
      <dc:date>2015-04-01T19:33:22Z</dc:date>
    </item>
    <item>
      <title>Re: Search Items in a Lookup Table NOT present in Index</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-Items-in-a-Lookup-Table-NOT-present-in-Index/m-p/595610#M207292</link>
      <description>&lt;P&gt;Hello All,&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I have a usecase of fetching list of hosts in an index but not listed in the lookup table.&lt;/P&gt;&lt;P&gt;For example: -&lt;BR /&gt;indexA has 5 hosts: host1. host2. host3, host4, host5&lt;/P&gt;&lt;P&gt;In lookup table, we have two columns: -&lt;BR /&gt;index&lt;BR /&gt;host&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;TABLE border="1" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="50%"&gt;&lt;STRONG&gt;index&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD width="50%"&gt;&lt;STRONG&gt;host&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%"&gt;indexA&lt;/TD&gt;&lt;TD width="50%"&gt;host1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%"&gt;indexA&lt;/TD&gt;&lt;TD width="50%"&gt;host3&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thus, as the result I need host2, host4, host5.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;It would be great to receive any inputs that helps to build the logic for the solution.&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Wed, 27 Apr 2022 15:37:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-Items-in-a-Lookup-Table-NOT-present-in-Index/m-p/595610#M207292</guid>
      <dc:creator>Taruchit</dc:creator>
      <dc:date>2022-04-27T15:37:40Z</dc:date>
    </item>
    <item>
      <title>Re: Search Items in a Lookup Table NOT present in Index</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-Items-in-a-Lookup-Table-NOT-present-in-Index/m-p/598291#M208334</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/158851"&gt;@djn12313&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Your SPL works successfully to fetch records present in lookup table and not in index.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you please share if the same query can be extended to fetch the max(_time) of the events returned by the SPL? That means, displaying the events along with the time when they were last present in the index.&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Wed, 18 May 2022 11:34:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-Items-in-a-Lookup-Table-NOT-present-in-Index/m-p/598291#M208334</guid>
      <dc:creator>Taruchit</dc:creator>
      <dc:date>2022-05-18T11:34:12Z</dc:date>
    </item>
    <item>
      <title>Re: Search Items in a Lookup Table NOT present in Index</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-Items-in-a-Lookup-Table-NOT-present-in-Index/m-p/608437#M211547</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/158851"&gt;@djn12313&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;I tried using the approach you shared in the above post, however, I am still getting results which are common in search results and lookup table.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;|inputlookup table.csv |fields index, host | search NOT [search index="xxx" |rename orig_* AS * | dedup host | table index, ssc_division, host | format]&lt;/LI-CODE&gt;&lt;P&gt;In the index, field names are orig_host and orig_index, thus, used rename.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thus, please share how I can get those results which are present in lookup table and not fetched in Splunk logs.&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Fri, 05 Aug 2022 12:35:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-Items-in-a-Lookup-Table-NOT-present-in-Index/m-p/608437#M211547</guid>
      <dc:creator>Taruchit</dc:creator>
      <dc:date>2022-08-05T12:35:04Z</dc:date>
    </item>
  </channel>
</rss>

