<?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: Splunk Join query to find common values ? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Splunk-Join-query-to-find-common-values/m-p/288639#M87389</link>
    <description>&lt;P&gt;Hi karthi2809,&lt;/P&gt;

&lt;P&gt;Sorry, to jump on this already answered question, but you should not use &lt;CODE&gt;join&lt;/CODE&gt; for multiple reasons like subsearch limits and timeouts you can hit without even noticing. &lt;/P&gt;

&lt;P&gt;Your example can be solved like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;( source="A" LEGACY_SYSTEM_NAME=* GUID=* ) OR ( source="B" ERROR_CODE="Y42" CS_GUID ) 
| eval UID=case(isnotnull(GUID), GUID, isnotnull(CS_GUID), CS_GUID, 1=1, "unknown")
| stats values(*) AS * by UID
| stats count by LEGACY_SYSTEM_NAME ERROR_CODE
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Take a look at this answer &lt;A href="https://answers.splunk.com/answers/129424/how-to-compare-fields-over-multiple-sourcetypes-without-join-append-or-use-of-subsearches.html"&gt;https://answers.splunk.com/answers/129424/how-to-compare-fields-over-multiple-sourcetypes-without-join-append-or-use-of-subsearches.html&lt;/A&gt; to learn more or read the March 2016 virtual .conf session &lt;A href="http://wiki.splunk.com/Virtual_.conf"&gt;http://wiki.splunk.com/Virtual_.conf&lt;/A&gt; from Nick Mealy about &lt;CODE&gt;Best practices around grouping and aggregating data from different search results&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Hope this helps ...&lt;/P&gt;

&lt;P&gt;cheers, MuS&lt;/P&gt;</description>
    <pubDate>Sun, 18 Feb 2018 19:42:31 GMT</pubDate>
    <dc:creator>MuS</dc:creator>
    <dc:date>2018-02-18T19:42:31Z</dc:date>
    <item>
      <title>Splunk Join query to find common values ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-Join-query-to-find-common-values/m-p/288637#M87387</link>
      <description>&lt;P&gt;i have two source A and B &lt;/P&gt;

&lt;P&gt;Log A:&lt;BR /&gt;&lt;BR /&gt;
REQUEST_TS="2018-02-16 01:20:05.303" REPLY_TS="2018-02-16 01:20:05.53" SENDER_ID=RT00267C TRAN_TYPE=270 COMMONAPP_STATUS=Error COMMONAPP_MSGID=INPUTERROR:PP3 LEGACY_SYSTEM_NAME=  GUID=4c903502:1619ba64276:-27f2 CLIENT_GUID=4c903502:1619ba64276:-27f3 CONTROL_NUMBER=000000001&lt;/P&gt;

&lt;P&gt;Log B&lt;BR /&gt;&lt;BR /&gt;
CS_GUID=4c903502:1619ba64276:-27f2  STATUS=Error ERROR_CODE=Y42 ERROR_MESSAGE= ERROR_MESSAGE_DETAILS= MESSAGE_TS="2018-02-16 01:20:05.619"&lt;/P&gt;

&lt;P&gt;IN this GUID and CS_GUID is common values .compare the two source and get the ERROR_CODE=Y42.And to get  stats count by LEGACY_SYSTEM_NAME ERROR_CODE&lt;/P&gt;

&lt;P&gt;can any one help on this query?&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 18:04:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-Join-query-to-find-common-values/m-p/288637#M87387</guid>
      <dc:creator>karthi2809</dc:creator>
      <dc:date>2020-09-29T18:04:33Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk Join query to find common values ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-Join-query-to-find-common-values/m-p/288638#M87388</link>
      <description>&lt;P&gt;Try like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;source="A"|rename GUID as CS_GUID| join CS_GUID[search source="B"|search ERROR_CODE="Y42"]|stats count by LEGACY_SYSTEM_NAME ERROR_CODE
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 16 Feb 2018 06:37:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-Join-query-to-find-common-values/m-p/288638#M87388</guid>
      <dc:creator>493669</dc:creator>
      <dc:date>2018-02-16T06:37:25Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk Join query to find common values ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-Join-query-to-find-common-values/m-p/288639#M87389</link>
      <description>&lt;P&gt;Hi karthi2809,&lt;/P&gt;

&lt;P&gt;Sorry, to jump on this already answered question, but you should not use &lt;CODE&gt;join&lt;/CODE&gt; for multiple reasons like subsearch limits and timeouts you can hit without even noticing. &lt;/P&gt;

&lt;P&gt;Your example can be solved like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;( source="A" LEGACY_SYSTEM_NAME=* GUID=* ) OR ( source="B" ERROR_CODE="Y42" CS_GUID ) 
| eval UID=case(isnotnull(GUID), GUID, isnotnull(CS_GUID), CS_GUID, 1=1, "unknown")
| stats values(*) AS * by UID
| stats count by LEGACY_SYSTEM_NAME ERROR_CODE
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Take a look at this answer &lt;A href="https://answers.splunk.com/answers/129424/how-to-compare-fields-over-multiple-sourcetypes-without-join-append-or-use-of-subsearches.html"&gt;https://answers.splunk.com/answers/129424/how-to-compare-fields-over-multiple-sourcetypes-without-join-append-or-use-of-subsearches.html&lt;/A&gt; to learn more or read the March 2016 virtual .conf session &lt;A href="http://wiki.splunk.com/Virtual_.conf"&gt;http://wiki.splunk.com/Virtual_.conf&lt;/A&gt; from Nick Mealy about &lt;CODE&gt;Best practices around grouping and aggregating data from different search results&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Hope this helps ...&lt;/P&gt;

&lt;P&gt;cheers, MuS&lt;/P&gt;</description>
      <pubDate>Sun, 18 Feb 2018 19:42:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-Join-query-to-find-common-values/m-p/288639#M87389</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2018-02-18T19:42:31Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk Join query to find common values ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-Join-query-to-find-common-values/m-p/288640#M87390</link>
      <description>&lt;P&gt;I'm having the same problem. Mine doesn't work with the inner or left join, although I can see the event from the left join, but without the fields from the other source.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=IDX_A event.url = "http://some.url"
| rename event.ts_srcip as dest_ip
| join dest_ip [search index=IDX_B]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I can confirm the main query and the subsearch, return results when executed separately. The IDX_A has the field event.ts_srcip which is wrong and should be the dest_ip. The IDX_B has the field dest_ip and has the correct src_ip field, which is what I'm trying to get from this join.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 21:22:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-Join-query-to-find-common-values/m-p/288640#M87390</guid>
      <dc:creator>seomisp</dc:creator>
      <dc:date>2020-09-29T21:22:22Z</dc:date>
    </item>
  </channel>
</rss>

