<?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: Is it possible to combine 3 searches with JOIN? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Is-it-possible-to-combine-3-searches-with-JOIN/m-p/231261#M68594</link>
    <description>&lt;P&gt;In my case data will be like first two will have same details like IP, ID, etc... and third part won't have IP but have ID and all index &amp;amp; sourcetypes are same. So want to join the third par with  2nd part based on ID field as common and have to combine the result with 1st part based on IP field as common.&lt;/P&gt;

&lt;P&gt;I already tried with  &lt;CODE&gt;index=a |join ipaddress [search index=b |table ipaddress uniqueId ]| join uniqueId [search index=c|table uniqueId sample]|stats values(uniqueId) by ipaddress&lt;/CODE&gt; and &lt;CODE&gt;index=a |join ipaddress [search index=b |table ipaddress uniqueId | join uniqueId [search index=c|table uniqueId sample]]|stats values(uniqueId) by ipaddress&lt;/CODE&gt; but the second part values are not populating&lt;/P&gt;</description>
    <pubDate>Fri, 07 Oct 2016 03:19:16 GMT</pubDate>
    <dc:creator>kamaleshwarn</dc:creator>
    <dc:date>2016-10-07T03:19:16Z</dc:date>
    <item>
      <title>Is it possible to combine 3 searches with JOIN?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-it-possible-to-combine-3-searches-with-JOIN/m-p/231258#M68591</link>
      <description>&lt;P&gt;Have question like how to join 3 subsearches, usually we can join the searches with similar field (ex: join samplefield [....). But here the scenario is bit different like below&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=* (search cmd) | join ipaddress [ search index=* ipaddress uniqueID....| join uniqueID [search index=*  uniqueID sample....]] | stats values(uniqueID) BY ipaddress
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Is there any possibility to join like above scenario.. Thanks in advance&lt;/P&gt;</description>
      <pubDate>Wed, 05 Oct 2016 10:40:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-it-possible-to-combine-3-searches-with-JOIN/m-p/231258#M68591</guid>
      <dc:creator>kamaleshwarn</dc:creator>
      <dc:date>2016-10-05T10:40:20Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to combine 3 searches with JOIN?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-it-possible-to-combine-3-searches-with-JOIN/m-p/231259#M68592</link>
      <description>&lt;P&gt;Technically, it is possible, but there could be a better way to achieve this. Could you please provide more details on what you're trying to achieve, how your data looks like from all three searches etc? Joins are expensive and should be avoided wherever possible.&lt;/P&gt;</description>
      <pubDate>Wed, 05 Oct 2016 17:15:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-it-possible-to-combine-3-searches-with-JOIN/m-p/231259#M68592</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-10-05T17:15:46Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to combine 3 searches with JOIN?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-it-possible-to-combine-3-searches-with-JOIN/m-p/231260#M68593</link>
      <description>&lt;P&gt;I agree with somesoni2. If you have 3 indexes/sourcetypes that all have the same joining field, you can do a &lt;CODE&gt;index=a OR index=b OR index=c|stats values(d) by commonField&lt;/CODE&gt;&lt;BR /&gt;
to join them all together. &lt;/P&gt;

&lt;P&gt;However, there are cases where you have to join c to b and b to a because a and c do not have a common field to join on. I run into this in one of my reports. &lt;/P&gt;

&lt;P&gt;this examples as a join inside of a join&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=a |join ipaddress [search index=b |table ipaddress uniqueId | join uniqueId [search index=c|table uniqueId sample]]|stats values(uniqueId) by ipaddress
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;or this joins them separately&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=a |join ipaddress [search index=b |table ipaddress uniqueId ]| join uniqueId [search index=c|table uniqueId sample]|stats values(uniqueId) by ipaddress
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 06 Oct 2016 15:59:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-it-possible-to-combine-3-searches-with-JOIN/m-p/231260#M68593</guid>
      <dc:creator>cmerriman</dc:creator>
      <dc:date>2016-10-06T15:59:17Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to combine 3 searches with JOIN?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-it-possible-to-combine-3-searches-with-JOIN/m-p/231261#M68594</link>
      <description>&lt;P&gt;In my case data will be like first two will have same details like IP, ID, etc... and third part won't have IP but have ID and all index &amp;amp; sourcetypes are same. So want to join the third par with  2nd part based on ID field as common and have to combine the result with 1st part based on IP field as common.&lt;/P&gt;

&lt;P&gt;I already tried with  &lt;CODE&gt;index=a |join ipaddress [search index=b |table ipaddress uniqueId ]| join uniqueId [search index=c|table uniqueId sample]|stats values(uniqueId) by ipaddress&lt;/CODE&gt; and &lt;CODE&gt;index=a |join ipaddress [search index=b |table ipaddress uniqueId | join uniqueId [search index=c|table uniqueId sample]]|stats values(uniqueId) by ipaddress&lt;/CODE&gt; but the second part values are not populating&lt;/P&gt;</description>
      <pubDate>Fri, 07 Oct 2016 03:19:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-it-possible-to-combine-3-searches-with-JOIN/m-p/231261#M68594</guid>
      <dc:creator>kamaleshwarn</dc:creator>
      <dc:date>2016-10-07T03:19:16Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to combine 3 searches with JOIN?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-it-possible-to-combine-3-searches-with-JOIN/m-p/231262#M68595</link>
      <description>&lt;P&gt;As pointed out above, there should be a better way to make your query than using multiple joins. However, it is possible. Here is an example query with four joins, with real data names redacted:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| pivot sdl s count(s) AS acr FILTER acrs is true | join [| pivot sdl s count(s) AS ncfs FILTER ucfs is true] | join [| pivot sdl s count(s) AS ucfs FILTER ucfsn is true] | join [| pivot sdl s count(s) AS dnds FILTER dndsn is true FILTER dnde is false] | join [| pivot sdl s count(s) AS dnde FILTER dndsn is true FILTER dnde is true] | eval ft="acr ncf ucf dnd" | makemv ft | mvexpand ft | eval so=case(ft=="acr", acr,ft="ncf", ncfs,ft="ucf",ucfs, ft="dnd", dnds) | eval enabled=case(ft=="acr", acre, ft="ncf", ncf_Enabled, ft="ucf", ucf_Enabled, ft="dnd", dnde) | fields ft,so,enabled
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 07 Oct 2016 08:41:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-it-possible-to-combine-3-searches-with-JOIN/m-p/231262#M68595</guid>
      <dc:creator>bhawkins1</dc:creator>
      <dc:date>2016-10-07T08:41:27Z</dc:date>
    </item>
  </channel>
</rss>

