<?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: How to join 2 searches using time range? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-join-2-searches-using-time-range/m-p/375538#M110352</link>
    <description>&lt;P&gt;@stwong,&lt;BR /&gt;
if it works for you then please accept the answer.&lt;/P&gt;</description>
    <pubDate>Tue, 20 Feb 2018 10:46:25 GMT</pubDate>
    <dc:creator>493669</dc:creator>
    <dc:date>2018-02-20T10:46:25Z</dc:date>
    <item>
      <title>How to join 2 searches using time range?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-join-2-searches-using-time-range/m-p/375535#M110349</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;

&lt;P&gt;We're trying to combine 2 searches:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Search 1:  application transaction log
 ...| transaction connId | eval start=_time | eval end=_time+duration | table start, end, connId, clientIP

Search 2:  VPN log
...| transaction Acct_Session_Id | eval start1=_time | eval end1=_time+duration | table start1, end1, Acct_Session_Id, NAS_IP_Address, UserName
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;We hope to combine the search by: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;start&amp;lt;=start1 end&amp;gt;=end1 clientIP=NAS_IP_Address
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Giving a table of:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;start, end, connid, start1, end1, clientIP, start1, end1, Acct_Session_id, NAS_IP_Address, UserName
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Tried with left join like &lt;CODE&gt;"search1 | eval NAS_IP_Address = clientIP | join type=left usetime=true earlier=false NAS_IP_Address [search 2]"&lt;/CODE&gt; but failed.&lt;/P&gt;

&lt;P&gt;Would anyone please advise?&lt;/P&gt;

&lt;P&gt;Thanks and rgds.&lt;BR /&gt;
/ST Wong&lt;/P&gt;</description>
      <pubDate>Wed, 14 Feb 2018 18:26:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-join-2-searches-using-time-range/m-p/375535#M110349</guid>
      <dc:creator>stwong</dc:creator>
      <dc:date>2018-02-14T18:26:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to join 2 searches using time range?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-join-2-searches-using-time-range/m-p/375536#M110350</link>
      <description>&lt;P&gt;have you tried this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;...| transaction connId | eval start=_time | eval end=_time+duration | table start, end, connId, clientIP|join type=left usetime=true earlier=false clientIP[search......| transaction Acct_Session_Id | eval start1=_time | eval end1=_time+duration |rename NAS_IP_Address as clientIP| table start1, end1, Acct_Session_Id, NAS_IP_Address, UserName]
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 14 Feb 2018 18:40:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-join-2-searches-using-time-range/m-p/375536#M110350</guid>
      <dc:creator>493669</dc:creator>
      <dc:date>2018-02-14T18:40:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to join 2 searches using time range?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-join-2-searches-using-time-range/m-p/375537#M110351</link>
      <description>&lt;P&gt;Hi, thanks for your help.  &lt;/P&gt;

&lt;P&gt;The first part of the output table (start, end connId, clientIP) gives 9 lines from Search 1.&lt;BR /&gt;
The second part of the output table (start1, end1, Acct_Session_Id, NAS_IP_Address, User_Name) returns identical rows, i.e. the same set of values repeated 9 times.  I wonder if the usetime option works for transactions in the 2 searches.&lt;/P&gt;

&lt;P&gt;I tried using map and seems it works as expected.  &lt;/P&gt;

&lt;P&gt;Thanks again.&lt;BR /&gt;
Rgds&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 18:06:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-join-2-searches-using-time-range/m-p/375537#M110351</guid>
      <dc:creator>stwong</dc:creator>
      <dc:date>2020-09-29T18:06:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to join 2 searches using time range?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-join-2-searches-using-time-range/m-p/375538#M110352</link>
      <description>&lt;P&gt;@stwong,&lt;BR /&gt;
if it works for you then please accept the answer.&lt;/P&gt;</description>
      <pubDate>Tue, 20 Feb 2018 10:46:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-join-2-searches-using-time-range/m-p/375538#M110352</guid>
      <dc:creator>493669</dc:creator>
      <dc:date>2018-02-20T10:46:25Z</dc:date>
    </item>
  </channel>
</rss>

