<?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: Use another index as lookup in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Use-another-index-as-lookup/m-p/479279#M143268</link>
    <description>&lt;P&gt;index = email SERIALNUM Subject | table SERIALNUM Subject location ipaddress racknumber&lt;/P&gt;

&lt;P&gt;With a normal lookup, SERIALNUM would be used to match the field Serialnumber to a CSV file and "Lookup output fields" would be defined as location ipaddress racknumber&lt;/P&gt;

&lt;P&gt;I have another index called "database" with the fields Serialnumber, location, ipaddress, racknumber&lt;/P&gt;

&lt;P&gt;So i want to do the match from the first index email against the database index.&lt;/P&gt;</description>
    <pubDate>Wed, 26 Feb 2020 11:46:31 GMT</pubDate>
    <dc:creator>arrowecssupport</dc:creator>
    <dc:date>2020-02-26T11:46:31Z</dc:date>
    <item>
      <title>Use another index as lookup</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Use-another-index-as-lookup/m-p/479277#M143266</link>
      <description>&lt;P&gt;So I'm trying to enrich one search, by pulling fields from another index, they have a matching pair of fields Serialnumber &amp;amp; SERIALNUM.&lt;/P&gt;

&lt;P&gt;How would I do this?&lt;/P&gt;</description>
      <pubDate>Wed, 26 Feb 2020 11:32:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Use-another-index-as-lookup/m-p/479277#M143266</guid>
      <dc:creator>arrowecssupport</dc:creator>
      <dc:date>2020-02-26T11:32:48Z</dc:date>
    </item>
    <item>
      <title>Re: Use another index as lookup</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Use-another-index-as-lookup/m-p/479278#M143267</link>
      <description>&lt;P&gt;Hi @arrowecssupport,&lt;BR /&gt;
could you share an example of events to correlate?&lt;/P&gt;

&lt;P&gt;Ciao.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Wed, 26 Feb 2020 11:34:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Use-another-index-as-lookup/m-p/479278#M143267</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2020-02-26T11:34:24Z</dc:date>
    </item>
    <item>
      <title>Re: Use another index as lookup</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Use-another-index-as-lookup/m-p/479279#M143268</link>
      <description>&lt;P&gt;index = email SERIALNUM Subject | table SERIALNUM Subject location ipaddress racknumber&lt;/P&gt;

&lt;P&gt;With a normal lookup, SERIALNUM would be used to match the field Serialnumber to a CSV file and "Lookup output fields" would be defined as location ipaddress racknumber&lt;/P&gt;

&lt;P&gt;I have another index called "database" with the fields Serialnumber, location, ipaddress, racknumber&lt;/P&gt;

&lt;P&gt;So i want to do the match from the first index email against the database index.&lt;/P&gt;</description>
      <pubDate>Wed, 26 Feb 2020 11:46:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Use-another-index-as-lookup/m-p/479279#M143268</guid>
      <dc:creator>arrowecssupport</dc:creator>
      <dc:date>2020-02-26T11:46:31Z</dc:date>
    </item>
    <item>
      <title>Re: Use another index as lookup</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Use-another-index-as-lookup/m-p/479280#M143269</link>
      <description>&lt;P&gt;Hi @Hi @arrowecssupport,&lt;BR /&gt;
I see that you have the same fields in both the indexes, why do you want to correlate the two indexes?&lt;BR /&gt;
if you want to take fields from both the indexes you can use the following two approaches.&lt;BR /&gt;
If you want instead to filter the first index with the results of the second, see the last search.&lt;/P&gt;

&lt;P&gt;you can use the join command that works as a database join:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index = email SERIALNUM Subject 
| join SERIALNUM  [ search index=database | rename Serialnumber AS SERIALNUM ]
| table SERIALNUM Subject location ipaddress racknumber 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;but it's a very slow command and there's the limit of 50,000 results in the subsearch.&lt;/P&gt;

&lt;P&gt;You can also use a different approach:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;(index = email SERIALNUM Subject) OR (index=database)
| eval SERIALNUM=coalesce(Serialnumber, SERIALNUM)
| stats values(Subject) AS Subject values(location) AS location values(ipaddress) AS ipaddress values(racknumber) AS racknumber BY SERIALNUM
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If at least you want to filter the first index by the second, you can use something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index = email SERIALNUM Subject [ search index=database | rename Serialnumber AS SERIALNUM | fields SERIALNUM ]
| table SERIALNUM Subject location ipaddress racknumber 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;In all the searches it isn't clear what's the condition for SERIALNUM Subject that you have in the main search.&lt;/P&gt;

&lt;P&gt;Ciao.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Wed, 26 Feb 2020 12:04:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Use-another-index-as-lookup/m-p/479280#M143269</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2020-02-26T12:04:47Z</dc:date>
    </item>
    <item>
      <title>Re: Use another index as lookup</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Use-another-index-as-lookup/m-p/479281#M143270</link>
      <description>&lt;P&gt;Only downside with option 1 is that when Serialnumber  doesn't exist it doesn't return records. &lt;BR /&gt;
So i onlt get records when a match is found. &lt;/P&gt;

&lt;P&gt;Sometimes there wont be a match. &lt;/P&gt;</description>
      <pubDate>Wed, 26 Feb 2020 13:51:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Use-another-index-as-lookup/m-p/479281#M143270</guid>
      <dc:creator>arrowecssupport</dc:creator>
      <dc:date>2020-02-26T13:51:08Z</dc:date>
    </item>
    <item>
      <title>Re: Use another index as lookup</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Use-another-index-as-lookup/m-p/479282#M143271</link>
      <description>&lt;P&gt;Hi @arrowecssupport,&lt;BR /&gt;
sorry but I don't understand what you want to extract:&lt;BR /&gt;
do you want the events where there's a match between the two indexes or when there isn't any match?&lt;BR /&gt;
or do you want a label to know if there's a match or not?&lt;/P&gt;

&lt;P&gt;Ciao.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Wed, 26 Feb 2020 13:55:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Use-another-index-as-lookup/m-p/479282#M143271</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2020-02-26T13:55:48Z</dc:date>
    </item>
    <item>
      <title>Re: Use another index as lookup</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Use-another-index-as-lookup/m-p/479283#M143272</link>
      <description>&lt;P&gt;When there is a match I want the values to be joined to the event.&lt;BR /&gt;
But when a match isn't found i still want the original event to be found.&lt;/P&gt;

&lt;P&gt;At the moment there are 7 events but only 3 matches and it's not returning the other 4.&lt;/P&gt;</description>
      <pubDate>Wed, 26 Feb 2020 14:06:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Use-another-index-as-lookup/m-p/479283#M143272</guid>
      <dc:creator>arrowecssupport</dc:creator>
      <dc:date>2020-02-26T14:06:11Z</dc:date>
    </item>
    <item>
      <title>Re: Use another index as lookup</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Use-another-index-as-lookup/m-p/479284#M143273</link>
      <description>&lt;P&gt;Hi @arrowecssupport,&lt;BR /&gt;
try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;    index = email SERIALNUM Subject 
   | join SERIALNUM  type=left [ search index=database | rename Serialnumber AS SERIALNUM ]
   | table SERIALNUM Subject location ipaddress racknumber 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Ciao.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Wed, 26 Feb 2020 14:15:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Use-another-index-as-lookup/m-p/479284#M143273</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2020-02-26T14:15:56Z</dc:date>
    </item>
    <item>
      <title>Re: Use another index as lookup</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Use-another-index-as-lookup/m-p/479285#M143274</link>
      <description>&lt;P&gt;AMAZING THANK YOU SOLVED IT!&lt;/P&gt;</description>
      <pubDate>Wed, 26 Feb 2020 14:19:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Use-another-index-as-lookup/m-p/479285#M143274</guid>
      <dc:creator>arrowecssupport</dc:creator>
      <dc:date>2020-02-26T14:19:30Z</dc:date>
    </item>
    <item>
      <title>Re: Use another index as lookup</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Use-another-index-as-lookup/m-p/511295#M143286</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/149245"&gt;@arrowecssupport&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;Good!&lt;/P&gt;&lt;P&gt;Ciao ad Next Time.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;&lt;P&gt;P.S.: Karma Points are appreciated &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Jul 2020 10:43:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Use-another-index-as-lookup/m-p/511295#M143286</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2020-07-28T10:43:35Z</dc:date>
    </item>
  </channel>
</rss>

