<?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: What is the most efficient way of comparing two indexes. in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/What-is-the-most-efficient-way-of-comparing-two-indexes/m-p/424758#M121807</link>
    <description>&lt;P&gt;Hi michaelrosello,&lt;/P&gt;

&lt;P&gt;try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=indexA OR index=indexB 
| stats count dc(index) AS dc_idx values(*) AS * by Message_ID 
| where dc_idx = 1 
| table Transaction_Type Message_ID
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The &lt;CODE&gt;where&lt;/CODE&gt; clause is your filter to get events that are either only in one of the indexes (1) or in both (2).&lt;/P&gt;

&lt;P&gt;Hope this helps ...&lt;/P&gt;

&lt;P&gt;cheers, MuS&lt;/P&gt;</description>
    <pubDate>Thu, 31 May 2018 02:56:53 GMT</pubDate>
    <dc:creator>MuS</dc:creator>
    <dc:date>2018-05-31T02:56:53Z</dc:date>
    <item>
      <title>What is the most efficient way of comparing two indexes.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/What-is-the-most-efficient-way-of-comparing-two-indexes/m-p/424757#M121806</link>
      <description>&lt;P&gt;I'm comparing in event1 from indexA is existing in indexB.&lt;BR /&gt;
Currently I am using join in comparing this two indexes but it is slow when a lot of data exist.&lt;/P&gt;

&lt;P&gt;Is there a more faster and efficient way in achieving this result?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=indexA 
        | eval indexA_message_id = Message_ID
        | join type=outer Message_ID
    [ search index=indexB
    | eval indexB_message_id = Message_ID 
    | fields Message_ID mdh_message_id]
| where NOT indexA_message_id=indexB_message_id
| table Transaction_Type indexA_message_id
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 31 May 2018 02:40:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/What-is-the-most-efficient-way-of-comparing-two-indexes/m-p/424757#M121806</guid>
      <dc:creator>michaelrosello</dc:creator>
      <dc:date>2018-05-31T02:40:44Z</dc:date>
    </item>
    <item>
      <title>Re: What is the most efficient way of comparing two indexes.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/What-is-the-most-efficient-way-of-comparing-two-indexes/m-p/424758#M121807</link>
      <description>&lt;P&gt;Hi michaelrosello,&lt;/P&gt;

&lt;P&gt;try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=indexA OR index=indexB 
| stats count dc(index) AS dc_idx values(*) AS * by Message_ID 
| where dc_idx = 1 
| table Transaction_Type Message_ID
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The &lt;CODE&gt;where&lt;/CODE&gt; clause is your filter to get events that are either only in one of the indexes (1) or in both (2).&lt;/P&gt;

&lt;P&gt;Hope this helps ...&lt;/P&gt;

&lt;P&gt;cheers, MuS&lt;/P&gt;</description>
      <pubDate>Thu, 31 May 2018 02:56:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/What-is-the-most-efficient-way-of-comparing-two-indexes/m-p/424758#M121807</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2018-05-31T02:56:53Z</dc:date>
    </item>
  </channel>
</rss>

