<?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 How to join searches based on condition? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-join-searches-based-on-condition/m-p/427137#M122322</link>
    <description>&lt;P&gt;I have two searches :&lt;BR /&gt;
Duration for which a device uses the system&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;index=device | fields device_start_time,device_end_time,device_id, duration, system_id&lt;/CODE&gt;&lt;BR /&gt;
Time for which system is running &lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;index=system | fields system_start_time,system_end_time, system_id, system_spec1,sstem_spec2,system_spec3&lt;/CODE&gt;&lt;BR /&gt;
Now each device runs at different time, each system runs at different time. The multiple devices can subscribe to one running system at a time and assumes the specifications of the system. System have different specifications for different system_start and system_end times. So the results should contain co-related events for each device such that like &lt;STRONG&gt;device_start_time&amp;gt;=system_start_time AND device_end_time&amp;lt;=system_end_time AND system_id matches&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;Final result:&lt;BR /&gt;
&lt;CODE&gt;device_id,system_id,system_spec1,system_spec2,system_spec3&lt;/CODE&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 30 Sep 2020 00:56:54 GMT</pubDate>
    <dc:creator>AnujaJ</dc:creator>
    <dc:date>2020-09-30T00:56:54Z</dc:date>
    <item>
      <title>How to join searches based on condition?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-join-searches-based-on-condition/m-p/427137#M122322</link>
      <description>&lt;P&gt;I have two searches :&lt;BR /&gt;
Duration for which a device uses the system&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;index=device | fields device_start_time,device_end_time,device_id, duration, system_id&lt;/CODE&gt;&lt;BR /&gt;
Time for which system is running &lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;index=system | fields system_start_time,system_end_time, system_id, system_spec1,sstem_spec2,system_spec3&lt;/CODE&gt;&lt;BR /&gt;
Now each device runs at different time, each system runs at different time. The multiple devices can subscribe to one running system at a time and assumes the specifications of the system. System have different specifications for different system_start and system_end times. So the results should contain co-related events for each device such that like &lt;STRONG&gt;device_start_time&amp;gt;=system_start_time AND device_end_time&amp;lt;=system_end_time AND system_id matches&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;Final result:&lt;BR /&gt;
&lt;CODE&gt;device_id,system_id,system_spec1,system_spec2,system_spec3&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 00:56:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-join-searches-based-on-condition/m-p/427137#M122322</guid>
      <dc:creator>AnujaJ</dc:creator>
      <dc:date>2020-09-30T00:56:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to join searches based on condition?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-join-searches-based-on-condition/m-p/427138#M122323</link>
      <description>&lt;P&gt;Hello @AnujaJ,&lt;/P&gt;

&lt;P&gt;Try this query:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=device | fields device_start_time,device_end_time,device_id, duration, system_id
| join system_id [| search index=system | fields system_start_time,system_end_time, system_id, system_spec1,sstem_spec2,system_spec3]
| where device_start_time&amp;gt;=system_start_time AND device_end_time&amp;lt;=system_end_time
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Hope this helps!!! If this is not what you wanted describe question more here in the comment.&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jun 2019 12:49:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-join-searches-based-on-condition/m-p/427138#M122323</guid>
      <dc:creator>VatsalJagani</dc:creator>
      <dc:date>2019-06-17T12:49:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to join searches based on condition?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-join-searches-based-on-condition/m-p/427139#M122324</link>
      <description>&lt;P&gt;Thank you that works perfectly! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; &lt;/P&gt;</description>
      <pubDate>Mon, 17 Jun 2019 13:02:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-join-searches-based-on-condition/m-p/427139#M122324</guid>
      <dc:creator>AnujaJ</dc:creator>
      <dc:date>2019-06-17T13:02:46Z</dc:date>
    </item>
  </channel>
</rss>

