<?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: InnerJoin with field subtraction on 2 fields part of different searchs. in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-inner-join-with-field-subtraction-on-two-fields-part-of/m-p/628911#M218460</link>
    <description>&lt;P&gt;Figured out the solution.&lt;/P&gt;</description>
    <pubDate>Mon, 30 Jan 2023 22:31:09 GMT</pubDate>
    <dc:creator>batham</dc:creator>
    <dc:date>2023-01-30T22:31:09Z</dc:date>
    <item>
      <title>How to inner join with field subtraction on two fields part of different searches?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-inner-join-with-field-subtraction-on-two-fields-part-of/m-p/628902#M218457</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I am using inner join to form a table between 2 search, search is working fine but i want to subtract 2 fields in which one field is part of one search and another field is part of next search, I am displaying response in a table which&amp;nbsp; contains data from both search&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;example&lt;/P&gt;
&lt;P&gt;line1: datetime: , trace: 12345 , Request Received: {1}, URL:http://&lt;/P&gt;
&lt;P&gt;line2:datetime: , trace: 12346 , Request Received: {2}, URL:http://&lt;/P&gt;
&lt;P&gt;line3:datetime: , trace:12345 , Reponse provided: {3}&lt;/P&gt;
&lt;P&gt;line4:datetime: ,trace:12346 , Reponse provided :{4}&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In line1 and line 3 trace is common field and so is in line 1 and line 4&lt;/P&gt;
&lt;P&gt;i have combined the result as&lt;/P&gt;
&lt;P&gt;.... | table trace, Request,startTime&lt;BR /&gt;|&amp;nbsp;join type=Inner trace&lt;BR /&gt;[ search .........&lt;BR /&gt;| table trace, Response,&amp;nbsp; EndTime]&lt;/P&gt;
&lt;P&gt;Which is giving me response as below&lt;/P&gt;
&lt;P&gt;trace&amp;nbsp; &amp;nbsp; &amp;nbsp; request&amp;nbsp; &amp;nbsp; &amp;nbsp;startTime&amp;nbsp; &amp;nbsp; &amp;nbsp;response&amp;nbsp; &amp;nbsp; &amp;nbsp;EndTime&lt;/P&gt;
&lt;P&gt;12345&amp;nbsp; &amp;nbsp;{1}&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 09:18:20&amp;nbsp; &amp;nbsp; &amp;nbsp; {3}.&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 09:18:50&lt;/P&gt;
&lt;P&gt;12346&amp;nbsp; &amp;nbsp;{2}&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;09:19:20&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{4}.&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;09:20:21&lt;/P&gt;
&lt;P&gt;I want to find out response time subtractingEndTime - startTime.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Jan 2023 23:40:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-inner-join-with-field-subtraction-on-two-fields-part-of/m-p/628902#M218457</guid>
      <dc:creator>batham</dc:creator>
      <dc:date>2023-01-30T23:40:34Z</dc:date>
    </item>
    <item>
      <title>Re: InnerJoin with field subtraction on 2 fields part of different searchs.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-inner-join-with-field-subtraction-on-two-fields-part-of/m-p/628906#M218458</link>
      <description>&lt;P&gt;To subtract times, you first must convert the times into integer (epoch) form using &lt;FONT face="courier new,courier"&gt;strptime()&lt;/FONT&gt;.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;.... | table trace, Request,startTime
| join type=Inner trace
[ search .........
| table trace, Response,  EndTime]
| eval ST=strptime(startTime, "%H:%M:%S"), ET=strptime(EndTime, "%H:%M:%S")
| eval ResponseTime = ET - ST
| eval ResponseTime = tostring(ResponseTime, "duration")
| table trace request starTime response EndTime ResponseTime&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Jan 2023 21:36:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-inner-join-with-field-subtraction-on-two-fields-part-of/m-p/628906#M218458</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2023-01-30T21:36:04Z</dc:date>
    </item>
    <item>
      <title>Re: InnerJoin with field subtraction on 2 fields part of different searchs.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-inner-join-with-field-subtraction-on-two-fields-part-of/m-p/628911#M218460</link>
      <description>&lt;P&gt;Figured out the solution.&lt;/P&gt;</description>
      <pubDate>Mon, 30 Jan 2023 22:31:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-inner-join-with-field-subtraction-on-two-fields-part-of/m-p/628911#M218460</guid>
      <dc:creator>batham</dc:creator>
      <dc:date>2023-01-30T22:31:09Z</dc:date>
    </item>
  </channel>
</rss>

