<?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 Help with join in searches in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Help-with-join-in-searches/m-p/613487#M213216</link>
    <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;Need help with Left join&lt;/P&gt;&lt;P&gt;There are two queries as below&lt;/P&gt;&lt;P&gt;Query1&lt;/P&gt;&lt;P&gt;index=abc&amp;nbsp; sourcetype=123&amp;nbsp; &amp;nbsp;|&amp;nbsp; table a.b.requestGUID&amp;nbsp; EmplId&lt;/P&gt;&lt;P&gt;Query 2&lt;/P&gt;&lt;P&gt;index=adef&amp;nbsp; sourcetype=456&amp;nbsp; &amp;nbsp;|&amp;nbsp; table c.requestGUID&amp;nbsp; VacationStartDate&lt;/P&gt;&lt;P&gt;In query 1 the request guid is under an object b within an&amp;nbsp; object a (hence a.b.requestGUID)&lt;/P&gt;&lt;P&gt;In query 2&amp;nbsp;&amp;nbsp;the request guid is under a different object c (hence c.requestGUID)&lt;/P&gt;&lt;P&gt;what is the syntax to join query 1 &amp;amp; 2 on guid under two objects and see if an employee has a vacation coming up ( basically get Guid, emplID vacatioStartDate in one shot.)&lt;/P&gt;&lt;P&gt;These two queries only have guid as common field but they are under different objects.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks, for the help&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 17 Sep 2022 00:12:22 GMT</pubDate>
    <dc:creator>mailravi</dc:creator>
    <dc:date>2022-09-17T00:12:22Z</dc:date>
    <item>
      <title>Help with join in searches</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-join-in-searches/m-p/613487#M213216</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;Need help with Left join&lt;/P&gt;&lt;P&gt;There are two queries as below&lt;/P&gt;&lt;P&gt;Query1&lt;/P&gt;&lt;P&gt;index=abc&amp;nbsp; sourcetype=123&amp;nbsp; &amp;nbsp;|&amp;nbsp; table a.b.requestGUID&amp;nbsp; EmplId&lt;/P&gt;&lt;P&gt;Query 2&lt;/P&gt;&lt;P&gt;index=adef&amp;nbsp; sourcetype=456&amp;nbsp; &amp;nbsp;|&amp;nbsp; table c.requestGUID&amp;nbsp; VacationStartDate&lt;/P&gt;&lt;P&gt;In query 1 the request guid is under an object b within an&amp;nbsp; object a (hence a.b.requestGUID)&lt;/P&gt;&lt;P&gt;In query 2&amp;nbsp;&amp;nbsp;the request guid is under a different object c (hence c.requestGUID)&lt;/P&gt;&lt;P&gt;what is the syntax to join query 1 &amp;amp; 2 on guid under two objects and see if an employee has a vacation coming up ( basically get Guid, emplID vacatioStartDate in one shot.)&lt;/P&gt;&lt;P&gt;These two queries only have guid as common field but they are under different objects.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks, for the help&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 17 Sep 2022 00:12:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-join-in-searches/m-p/613487#M213216</guid>
      <dc:creator>mailravi</dc:creator>
      <dc:date>2022-09-17T00:12:22Z</dc:date>
    </item>
    <item>
      <title>Re: Help with join in searches</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-join-in-searches/m-p/613489#M213217</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/249561"&gt;@mailravi&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;don't think to the join command because it's a very slow command, use stats.&lt;/P&gt;&lt;P&gt;You have to correlate the two searches identifying the commn ield, something like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;(index=abc  sourcetype=123) OR (index=adef  sourcetype=456)
| eval requestGUID=coalesce(a.b.requestGUID,c.requestGUID)
| stats 
   values(EmplId) AS EmplId
   values(VacationStartDate) AS VacationStartDate
   BY requestGUID&lt;/LI-CODE&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Sat, 17 Sep 2022 04:29:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-join-in-searches/m-p/613489#M213217</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2022-09-17T04:29:44Z</dc:date>
    </item>
    <item>
      <title>Re: Help with join in searches</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-join-in-searches/m-p/613508#M213223</link>
      <description>&lt;P&gt;Thank you sir for the detail. Will try stats and update ( out for the weekend, no system access currently:)&amp;nbsp; )&lt;/P&gt;</description>
      <pubDate>Sat, 17 Sep 2022 16:39:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-join-in-searches/m-p/613508#M213223</guid>
      <dc:creator>mailravi</dc:creator>
      <dc:date>2022-09-17T16:39:36Z</dc:date>
    </item>
    <item>
      <title>Re: Help with join in searches</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-join-in-searches/m-p/613513#M213228</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/249561"&gt;@mailravi&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;ok, let me know.&lt;/P&gt;&lt;P&gt;Ciao&amp;nbsp;&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>Sun, 18 Sep 2022 05:36:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-join-in-searches/m-p/613513#M213228</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2022-09-18T05:36:16Z</dc:date>
    </item>
    <item>
      <title>Re: Help with join in searches</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-join-in-searches/m-p/613646#M213272</link>
      <description>&lt;P&gt;I tried eval and stats, it is not returning data when combined using eval and stats even though the individual searches&amp;nbsp; shows the emplId and Avacation plans.&lt;/P&gt;&lt;P&gt;Not sure what syntax error I am making.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is it the coalesce statement joining the two result sets?&lt;/P&gt;&lt;P&gt;Which is the exact place where Guid from one search is compared in the other in the combined query?&lt;/P&gt;&lt;P&gt;Thanks for all the help!&lt;/P&gt;</description>
      <pubDate>Mon, 19 Sep 2022 17:59:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-join-in-searches/m-p/613646#M213272</guid>
      <dc:creator>mailravi</dc:creator>
      <dc:date>2022-09-19T17:59:42Z</dc:date>
    </item>
    <item>
      <title>Re: Help with join in searches</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-join-in-searches/m-p/613705#M213295</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/249561"&gt;@mailravi&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;please share your search to check the syntax.&lt;/P&gt;&lt;P&gt;Anyway, coalesce the approach is to have one common field to group values from a.b and c.&lt;/P&gt;&lt;P&gt;The group command is stats, but you can group only having a common field.&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Tue, 20 Sep 2022 06:43:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-join-in-searches/m-p/613705#M213295</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2022-09-20T06:43:21Z</dc:date>
    </item>
    <item>
      <title>Re: Help with join in searches</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-join-in-searches/m-p/613710#M213297</link>
      <description>&lt;P&gt;As&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/161352"&gt;@gcusello&lt;/a&gt;&amp;nbsp;said, you most often do not need to think in terms of JOIN. &amp;nbsp;If you &lt;EM&gt;must&lt;/EM&gt;&amp;nbsp;have an analogy, you can think of stats' "by" as the "join". &amp;nbsp;The use of&amp;nbsp;&lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/ConditionalFunctions#coalesce.28X.2C....29" target="_blank" rel="noopener"&gt;coalesce&lt;/A&gt;&amp;nbsp;is equivalent to something like&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval requestGUID = if(isnull('a.b.requestGUID'), c.requestGUID, a.b.requestGUID)&lt;/LI-CODE&gt;&lt;P&gt;This is just to make sure that the same field name can be used in both source types to be used for groupby.&lt;/P&gt;&lt;P&gt;Now, to your results. &amp;nbsp;First, check all spelling, especially because a.b., c., etc. are not real field paths.&lt;/P&gt;&lt;P&gt;Then, follow the usual troubleshooting steps. &amp;nbsp;For example, observe eval without stats. &amp;nbsp;What does it give you in requestGUID?&lt;/P&gt;</description>
      <pubDate>Tue, 20 Sep 2022 06:56:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-join-in-searches/m-p/613710#M213297</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2022-09-20T06:56:46Z</dc:date>
    </item>
  </channel>
</rss>

