<?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 edit my join search to include all events from two indexes in search results? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-join-search-to-include-all-events-from-two/m-p/244125#M72658</link>
    <description>&lt;P&gt;Thanks , I used the "stats " + " append" and it worked. however still need to make some adjustments as the index exists the Hostname field and not B , that is, the data came as soon as there is the same certificate on different servers (Load Balancer &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;Certificate Hostname    Valid to&lt;BR /&gt;
Cert1       AA1             24/12/2016&lt;BR /&gt;
                BB1&lt;BR /&gt;
Cert2       AA2             01/12/2016&lt;BR /&gt;
                BB2     &lt;/P&gt;</description>
    <pubDate>Wed, 11 May 2016 14:46:43 GMT</pubDate>
    <dc:creator>rafaelvianaalve</dc:creator>
    <dc:date>2016-05-11T14:46:43Z</dc:date>
    <item>
      <title>How to edit my join search to include all events from two indexes in search results?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-join-search-to-include-all-events-from-two/m-p/244121#M72654</link>
      <description>&lt;P&gt;I have two indexes with digital certificate information ( &lt;STRONG&gt;indexA and IndexB&lt;/STRONG&gt; ). I used the join command to add some fields that the index does not have through the common field &lt;STRONG&gt;Site&lt;/STRONG&gt;.&lt;/P&gt;

&lt;P&gt;I need to make a merge between the two indexes as there are data that only the IndexA contains, and others that only contains IndexB .&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;Currently this syntax:&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=IndexA  | where HIERARCHY="1" |rename CN AS Site| join Site type=left max=0 [search index="IndexB" | dedup _raw | rename "Certification object" AS Site|fields Site,"Expiry Date","CI Name","Serial Number",Environment,SupplierName] |dedup Hostname Site  "Valid to" TIMESTAMPENTRADA2 | table Hostname Site "Expiry Date"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I tried the option &lt;CODE&gt;type=outer&lt;/CODE&gt;, but remained the same result.&lt;/P&gt;

&lt;P&gt;I also tried to use &lt;CODE&gt;index=indexA OR index=IndexB&lt;/CODE&gt;, but didn't work.&lt;/P&gt;</description>
      <pubDate>Tue, 10 May 2016 13:56:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-join-search-to-include-all-events-from-two/m-p/244121#M72654</guid>
      <dc:creator>rafaelvianaalve</dc:creator>
      <dc:date>2016-05-10T13:56:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my join search to include all events from two indexes in search results?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-join-search-to-include-all-events-from-two/m-p/244122#M72655</link>
      <description>&lt;P&gt;What exactly isn't working with the join?  You are aware that even when choosing an outer/left join that only events in indexB which match events in indexA will be included in the join, correct?  If you want both complete indexes in the results, then you should pick a different merge command.&lt;/P&gt;

&lt;P&gt;The 'dedup _raw' in your subsearch may be the problem.  My experiments generated missing data when I did the same.  Instead I ran a dedup on an extracted field, and all the values joined in the final results.  This behavior may be related to the 'earlier' option to join.&lt;BR /&gt;
By default, 'join' matches the main search results only against earlier results from the subsearch.  Set earlier=false if your indexB has newer timestamps than indexA.&lt;/P&gt;

&lt;P&gt;So maybe try the following:&lt;BR /&gt;
index=IndexA | where HIERARCHY="1" |rename CN AS Site  | join Site type=left [search index="IndexB" | dedup "Serial Number"| rename "Certification object" AS Site|fields Site,"Expiry Date","CI Name","Serial Number",Environment,SupplierName] |dedup Hostname Site "Valid to" TIMESTAMPENTRADA2 | table Hostname Site "Expiry Date"&lt;/P&gt;</description>
      <pubDate>Tue, 10 May 2016 20:09:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-join-search-to-include-all-events-from-two/m-p/244122#M72655</guid>
      <dc:creator>cb_usps</dc:creator>
      <dc:date>2016-05-10T20:09:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my join search to include all events from two indexes in search results?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-join-search-to-include-all-events-from-two/m-p/244123#M72656</link>
      <description>&lt;P&gt;Exactly, the join this returning only the data that have match with indexB , but I need to bring all the data even if not this match , join index (full) . Any idea?&lt;/P&gt;</description>
      <pubDate>Wed, 11 May 2016 12:03:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-join-search-to-include-all-events-from-two/m-p/244123#M72656</guid>
      <dc:creator>rafaelvianaalve</dc:creator>
      <dc:date>2016-05-11T12:03:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my join search to include all events from two indexes in search results?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-join-search-to-include-all-events-from-two/m-p/244124#M72657</link>
      <description>&lt;P&gt;Try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;(index=A AND HIERARCHY="1") OR index=B | eval Site=coalesce("Certification object", CN) | stats last(Hostname) as Hostname, last("Expiry Date") as "Expiry Date" by Site
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 11 May 2016 12:27:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-join-search-to-include-all-events-from-two/m-p/244124#M72657</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2016-05-11T12:27:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my join search to include all events from two indexes in search results?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-join-search-to-include-all-events-from-two/m-p/244125#M72658</link>
      <description>&lt;P&gt;Thanks , I used the "stats " + " append" and it worked. however still need to make some adjustments as the index exists the Hostname field and not B , that is, the data came as soon as there is the same certificate on different servers (Load Balancer &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;Certificate Hostname    Valid to&lt;BR /&gt;
Cert1       AA1             24/12/2016&lt;BR /&gt;
                BB1&lt;BR /&gt;
Cert2       AA2             01/12/2016&lt;BR /&gt;
                BB2     &lt;/P&gt;</description>
      <pubDate>Wed, 11 May 2016 14:46:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-join-search-to-include-all-events-from-two/m-p/244125#M72658</guid>
      <dc:creator>rafaelvianaalve</dc:creator>
      <dc:date>2016-05-11T14:46:43Z</dc:date>
    </item>
  </channel>
</rss>

