<?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: join two fields from same source in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/join-two-fields-from-same-source/m-p/191248#M55060</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;If you want the first acknowledgement (10:46:46) to be considered ignoring second (10:46:58). In sub search join you can filter using  SAVED ACK and then do &lt;/P&gt;

&lt;P&gt;..filter using "SAVED ACK"|sort by Time|convert dur2sec(Time) as TimeSec|eventstats min(TimeSec) as minTimeSec by dealId|where TimeSec==minTimeSec&lt;/P&gt;

&lt;P&gt;above subsearch will return all the first SAVED ACKs.&lt;/P&gt;

&lt;P&gt;You need to handle Day jump scenario by adding or negating 86400 to Time. &lt;/P&gt;</description>
    <pubDate>Wed, 20 May 2015 05:20:23 GMT</pubDate>
    <dc:creator>Arun_N_007</dc:creator>
    <dc:date>2015-05-20T05:20:23Z</dc:date>
    <item>
      <title>join two fields from same source</title>
      <link>https://community.splunk.com/t5/Splunk-Search/join-two-fields-from-same-source/m-p/191246#M55058</link>
      <description>&lt;P&gt;I have log file like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; deal - 123456 - notification receives from web  -- Time 10:46:42
 deal - 123456 - publishing xml    -- Time 10:46:43
 deal - 789012 - notification receives from web  -- Time 10:46:45
 deal - 123456 - SAVED ack  -- Time 10:46:46
 deal - 123456 - publishing xml  -- Time 10:46:49
 deal - 789012 - SAVED ack  -- Time 10:46:52
 deal - 123456 - SAVED ack  -- Time 10:46:58
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I want to create field called &lt;CODE&gt;deal id&lt;/CODE&gt; (for ex: 123456) and grab first line and create a field called &lt;CODE&gt;dealcreatedtime&lt;/CODE&gt; (Time 10:46:42) &lt;BR /&gt;
Then, I want to join or do a transaction with this (4th line) line&lt;BR /&gt;
  deal - 123456 - SAVED ack  -- Time 10:46:46. to create a field called &lt;CODE&gt;Dealsavedtime&lt;/CODE&gt;.&lt;/P&gt;

&lt;P&gt;So, I want to check how long it took to grab the same deal.&lt;BR /&gt;&lt;BR /&gt;
  Can you please help to get the logic? I tried join and subsearch, but subsearch is grabbing both lines like below and affecting results.   I tried to use tail in subsearch, but did not work.&lt;/P&gt;

&lt;P&gt;deal - 123456 - SAVED ack  -- Time 10:46:46&lt;BR /&gt;
  deal - 123456 - SAVED ack  -- Time 10:46:58&lt;/P&gt;</description>
      <pubDate>Tue, 19 May 2015 23:06:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/join-two-fields-from-same-source/m-p/191246#M55058</guid>
      <dc:creator>gudavasr</dc:creator>
      <dc:date>2015-05-19T23:06:56Z</dc:date>
    </item>
    <item>
      <title>Re: join two fields from same source</title>
      <link>https://community.splunk.com/t5/Splunk-Search/join-two-fields-from-same-source/m-p/191247#M55059</link>
      <description>&lt;P&gt;Assuming the event always ends with "SAVED ACK" you can use transaction and look at the duration. You need to extract that deal number as a field..&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | rex fields=_raw "deal - (?&amp;lt;deal_id&amp;gt;\d+)\s" | transaction deal_id endswith="SAVED ack" | table deal_id duration
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 19 May 2015 23:29:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/join-two-fields-from-same-source/m-p/191247#M55059</guid>
      <dc:creator>esix_splunk</dc:creator>
      <dc:date>2015-05-19T23:29:39Z</dc:date>
    </item>
    <item>
      <title>Re: join two fields from same source</title>
      <link>https://community.splunk.com/t5/Splunk-Search/join-two-fields-from-same-source/m-p/191248#M55060</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;If you want the first acknowledgement (10:46:46) to be considered ignoring second (10:46:58). In sub search join you can filter using  SAVED ACK and then do &lt;/P&gt;

&lt;P&gt;..filter using "SAVED ACK"|sort by Time|convert dur2sec(Time) as TimeSec|eventstats min(TimeSec) as minTimeSec by dealId|where TimeSec==minTimeSec&lt;/P&gt;

&lt;P&gt;above subsearch will return all the first SAVED ACKs.&lt;/P&gt;

&lt;P&gt;You need to handle Day jump scenario by adding or negating 86400 to Time. &lt;/P&gt;</description>
      <pubDate>Wed, 20 May 2015 05:20:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/join-two-fields-from-same-source/m-p/191248#M55060</guid>
      <dc:creator>Arun_N_007</dc:creator>
      <dc:date>2015-05-20T05:20:23Z</dc:date>
    </item>
  </channel>
</rss>

