<?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: Using a lookup table in a base search in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Using-a-lookup-table-in-a-base-search/m-p/700961#M237807</link>
    <description>&lt;P&gt;Try this one&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=&amp;lt;index&amp;gt;
  [inputlookup lookup_table | search NAME = "Toronto"
  | table ID]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 04 Oct 2024 01:25:03 GMT</pubDate>
    <dc:creator>jg91</dc:creator>
    <dc:date>2024-10-04T01:25:03Z</dc:date>
    <item>
      <title>Using a lookup table in a base search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Using-a-lookup-table-in-a-base-search/m-p/700953#M237802</link>
      <description>&lt;P&gt;I have a lookup table that we update on daily basis with two fields that are relevant here, NAME and ID.&amp;nbsp;&lt;/P&gt;&lt;TABLE border="1" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="50%"&gt;NAME&lt;/TD&gt;&lt;TD width="50%"&gt;ID&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%"&gt;Toronto&lt;/TD&gt;&lt;TD width="50%"&gt;765&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%"&gt;Toronto&lt;/TD&gt;&lt;TD width="50%"&gt;1157&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%"&gt;Toronto&lt;/TD&gt;&lt;TD width="50%"&gt;36&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to pull data from an index and filter for these three IDs. Normally I would just do&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&amp;lt;base search&amp;gt; &lt;BR /&gt;| lookup lookup_table ID OUTPUT NAME &lt;BR /&gt;| where NAME = "Toronto"&lt;/PRE&gt;&lt;P&gt;This works, but the search takes forever since the base search is pulling records from everywhere, and filtering afterward.&amp;nbsp; I'm wondering if it's possible to do something like this (psuedo code search incoming)&lt;/P&gt;&lt;PRE&gt;index=&amp;lt;index&amp;gt; ID IN (&lt;BR /&gt;    |[inputlookup lookup_table where NAME = "Toronto"])&lt;/PRE&gt;&lt;P&gt;Basically, I'm trying to save time by not pulling all the records at the beginning and instead filter on a dynamic value that I have to grab from a lookup table.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 04 Oct 2024 00:37:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Using-a-lookup-table-in-a-base-search/m-p/700953#M237802</guid>
      <dc:creator>DATT</dc:creator>
      <dc:date>2024-10-04T00:37:50Z</dc:date>
    </item>
    <item>
      <title>Re: Using a lookup table in a base search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Using-a-lookup-table-in-a-base-search/m-p/700956#M237804</link>
      <description>&lt;P&gt;This is Splunk. &amp;nbsp;The answer is always yes:-) &amp;nbsp;In this case, it's much simpler than you think:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=&amp;lt;index&amp;gt;
  [inputlookup lookup_table where NAME = "Toronto"
  | fields ID]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 04 Oct 2024 00:52:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Using-a-lookup-table-in-a-base-search/m-p/700956#M237804</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2024-10-04T00:52:48Z</dc:date>
    </item>
    <item>
      <title>Re: Using a lookup table in a base search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Using-a-lookup-table-in-a-base-search/m-p/700960#M237806</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think we should use &lt;U&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;table&lt;/FONT&gt;&lt;/U&gt; instead of &lt;U&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;fields&lt;/FONT&gt;&lt;/U&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 04 Oct 2024 01:27:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Using-a-lookup-table-in-a-base-search/m-p/700960#M237806</guid>
      <dc:creator>jg91</dc:creator>
      <dc:date>2024-10-04T01:27:18Z</dc:date>
    </item>
    <item>
      <title>Re: Using a lookup table in a base search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Using-a-lookup-table-in-a-base-search/m-p/700961#M237807</link>
      <description>&lt;P&gt;Try this one&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=&amp;lt;index&amp;gt;
  [inputlookup lookup_table | search NAME = "Toronto"
  | table ID]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 04 Oct 2024 01:25:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Using-a-lookup-table-in-a-base-search/m-p/700961#M237807</guid>
      <dc:creator>jg91</dc:creator>
      <dc:date>2024-10-04T01:25:03Z</dc:date>
    </item>
    <item>
      <title>Re: Using a lookup table in a base search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Using-a-lookup-table-in-a-base-search/m-p/700963#M237809</link>
      <description>&lt;P&gt;No difference with inputlookup. fields is usually preferred if working with an index search that fetches actual events.&lt;/P&gt;</description>
      <pubDate>Fri, 04 Oct 2024 01:43:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Using-a-lookup-table-in-a-base-search/m-p/700963#M237809</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2024-10-04T01:43:15Z</dc:date>
    </item>
    <item>
      <title>Re: Using a lookup table in a base search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Using-a-lookup-table-in-a-base-search/m-p/701023#M237826</link>
      <description>&lt;P&gt;This worked for me!&amp;nbsp; I'm kind of surprised how close my psuedo search was to the right answer!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I did modify this a little to use `search` instead of `where` so that I could add a dashboard token to this query as well.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 04 Oct 2024 16:31:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Using-a-lookup-table-in-a-base-search/m-p/701023#M237826</guid>
      <dc:creator>DATT</dc:creator>
      <dc:date>2024-10-04T16:31:15Z</dc:date>
    </item>
    <item>
      <title>Re: Using a lookup table in a base search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Using-a-lookup-table-in-a-base-search/m-p/701025#M237828</link>
      <description>&lt;P&gt;You can still use token in that where clause. &amp;nbsp;In fact, &lt;U&gt;where&lt;/U&gt; in an inputlookup uses the same syntax as search term, unlike&amp;nbsp;the &lt;FONT face="andale mono,times"&gt;where&lt;/FONT&gt; command that requires an eval expression.&lt;/P&gt;</description>
      <pubDate>Fri, 04 Oct 2024 16:50:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Using-a-lookup-table-in-a-base-search/m-p/701025#M237828</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2024-10-04T16:50:25Z</dc:date>
    </item>
  </channel>
</rss>

