<?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: Why is my join not working? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Why-is-my-join-not-working/m-p/609007#M211771</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/248103"&gt;@leftinnerouter&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;good for you, see next time!&lt;/P&gt;&lt;P&gt;Ciao and happy splunking&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;&lt;P&gt;P.S.: Karma Points are appreciated by all the contributors &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 10 Aug 2022 13:13:46 GMT</pubDate>
    <dc:creator>gcusello</dc:creator>
    <dc:date>2022-08-10T13:13:46Z</dc:date>
    <item>
      <title>Why is my join not working?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-my-join-not-working/m-p/607414#M211174</link>
      <description>&lt;P&gt;Basically my query should search an index for an ip in the last 4 hours and return 1 event.&lt;/P&gt;&lt;P&gt;Then it should left join on IP to a second index and search for results over the last 7 days.&lt;/P&gt;&lt;P&gt;The IP i am searching exists in both indexes.&lt;/P&gt;&lt;P&gt;Why are no results being returned?&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;earliest=-4h latest=now() index=data1 Source_Network_Address=10.1.1.1
| head 1
| rename Source_Network Address as IP
| join type=left IP max=5
[search earliest=-7d latest=now() index=data2
| fields IP, DNS]
| table index, _time, IP, DNS&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 28 Jul 2022 19:30:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-my-join-not-working/m-p/607414#M211174</guid>
      <dc:creator>leftinnerouter</dc:creator>
      <dc:date>2022-07-28T19:30:34Z</dc:date>
    </item>
    <item>
      <title>Re: Why is my join not working?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-my-join-not-working/m-p/607463#M211195</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/248103"&gt;@leftinnerouter&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;how many results have you running the subsearch by itself? probably more than 50,000.&lt;/P&gt;&lt;P&gt;There's a limit of 50,000 results in subsearches, in addition the join command is very slow.&lt;/P&gt;&lt;P&gt;You are in the usual error of people coming from SQL: Splunk isn't a DB and you should use join only when you haven't any other solution.&lt;/P&gt;&lt;P&gt;in your case, I suppose&amp;nbsp; that you want to check if the IP from the main search in 4 hours was present in the previous 7 days, is it correct?&lt;/P&gt;&lt;P&gt;If this is your requirement, please, try this approach:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=data2 earliest=-7d latest=now() [ search index=data1 Source_Network_Address=10.1.1.1 earliest=-4h latest=now() | head 1 | rename Source_Network Address as IP | fields IP ]
| table index _time IP DNS&lt;/LI-CODE&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Fri, 29 Jul 2022 06:15:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-my-join-not-working/m-p/607463#M211195</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2022-07-29T06:15:18Z</dc:date>
    </item>
    <item>
      <title>Re: Why is my join not working?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-my-join-not-working/m-p/608936#M211749</link>
      <description>&lt;P&gt;Sorry for the late response.&lt;/P&gt;&lt;P&gt;There are less than 50,000 results and I have attempted adding a limit as suggested.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Unfortunately this is still not working for me as expected.&lt;/P&gt;</description>
      <pubDate>Wed, 10 Aug 2022 01:30:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-my-join-not-working/m-p/608936#M211749</guid>
      <dc:creator>leftinnerouter</dc:creator>
      <dc:date>2022-08-10T01:30:32Z</dc:date>
    </item>
    <item>
      <title>Re: Why is my join not working?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-my-join-not-working/m-p/608937#M211750</link>
      <description>&lt;P&gt;Yes&amp;nbsp; I would like to&lt;SPAN&gt;&amp;nbsp;check if the IP from the main search in 4 hours was present in the previous 7 days.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Aug 2022 01:31:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-my-join-not-working/m-p/608937#M211750</guid>
      <dc:creator>leftinnerouter</dc:creator>
      <dc:date>2022-08-10T01:31:57Z</dc:date>
    </item>
    <item>
      <title>Re: Why is my join not working?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-my-join-not-working/m-p/608940#M211752</link>
      <description>&lt;P&gt;First check:&lt;/P&gt;&lt;P&gt;Two searches - do they return data.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;earliest=-4h latest=now() index=data1 Source_Network_Address=10.1.1.1
| head 1
| rename Source_Network Address as IP

AND

earliest=-7d latest=now() index=data2 IP=10.1.1.1
| table index, _time, IP, DNS&lt;/LI-CODE&gt;&lt;P&gt;Secondly, don't use join - if you're looking for a single IP in both 'index=data1' in last 4 hours&amp;nbsp; &amp;nbsp;AND 'index=data2' in last 7 days you could use a simple OR search&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;(earliest=-4h latest=now() index=data1 Source_Network_Address=10.1.1.1) OR 
(earliest=-7d latest=now() index=data2 IP=10.1.1.1)
| rename Source_Network Address as IP
| table index, _time, IP, DNS&lt;/LI-CODE&gt;&lt;P&gt;you can then control which of the returned entries you are interested in.&lt;/P&gt;&lt;P&gt;Note that if you DO you join, then always join on the smaller data set, otherwise you are likely to come up against limits. As&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/161352"&gt;@gcusello&lt;/a&gt;&amp;nbsp;says,&amp;nbsp; join is rarely the way to solve a Splunk query - there are almost always better ways to write the query, typically using 'stats' to join things together, e.g. you could end the above second query with&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| stats values(*) as * by IP&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Aug 2022 03:12:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-my-join-not-working/m-p/608940#M211752</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2022-08-10T03:12:30Z</dc:date>
    </item>
    <item>
      <title>Re: Why is my join not working?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-my-join-not-working/m-p/608997#M211769</link>
      <description>&lt;P&gt;&lt;A href="https://community.splunk.com/t5/user/viewprofilepage/user-id/161352" target="_blank"&gt;&lt;SPAN&gt;@bowesmana&lt;/SPAN&gt;&lt;/A&gt;&amp;nbsp;&lt;A href="https://community.splunk.com/t5/user/viewprofilepage/user-id/161352" target="_blank"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;@gcusello&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;thank you for your help. I've reverted to a simple search.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Aug 2022 12:13:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-my-join-not-working/m-p/608997#M211769</guid>
      <dc:creator>leftinnerouter</dc:creator>
      <dc:date>2022-08-10T12:13:40Z</dc:date>
    </item>
    <item>
      <title>Re: Why is my join not working?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-my-join-not-working/m-p/609007#M211771</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/248103"&gt;@leftinnerouter&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;good for you, see next time!&lt;/P&gt;&lt;P&gt;Ciao and happy splunking&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;&lt;P&gt;P.S.: Karma Points are appreciated by all the contributors &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Aug 2022 13:13:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-my-join-not-working/m-p/609007#M211771</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2022-08-10T13:13:46Z</dc:date>
    </item>
  </channel>
</rss>

