<?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: transaction duration between subevents in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/transaction-duration-between-subevents/m-p/53698#M13061</link>
    <description>&lt;P&gt;Hmm, you cant use &lt;CODE&gt;_time&lt;/CODE&gt; after the transaction, so you must make an eval before the transaction, in order to preserve the timestamp for each subevent in a multivalued field.&lt;/P&gt;

&lt;P&gt;...| eval sub_time = _time |&lt;/P&gt;</description>
    <pubDate>Tue, 03 Sep 2013 17:09:36 GMT</pubDate>
    <dc:creator>kristian_kolb</dc:creator>
    <dc:date>2013-09-03T17:09:36Z</dc:date>
    <item>
      <title>transaction duration between subevents</title>
      <link>https://community.splunk.com/t5/Splunk-Search/transaction-duration-between-subevents/m-p/53697#M13060</link>
      <description>&lt;P&gt;Is it possible to calculate all the duration between subevents in a transaction? For example.. &lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Here's the search:&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;index=citrix source="C:\Temp\tslogon_log.txt" | transaction UserName host startswith="STARTED" endswith="FINISH"&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;...and output&lt;/STRONG&gt;&lt;BR /&gt;
&lt;IMG src="http://splunk-base.splunk.com//storage/2013-09-03_1212.png" alt="alt text" /&gt;&lt;/P&gt;

&lt;P&gt;We would like to calculate the time difference between all steps in the transaction. So between Started and Step1_Complete, then Step1_Complete and Step2_Complete etc.. which all those differences should add to the 2.39 seconds Splunk calculated for the overall transaction. Any ideas?&lt;/P&gt;

&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 14:42:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/transaction-duration-between-subevents/m-p/53697#M13060</guid>
      <dc:creator>aaronkorn</dc:creator>
      <dc:date>2020-09-28T14:42:17Z</dc:date>
    </item>
    <item>
      <title>Re: transaction duration between subevents</title>
      <link>https://community.splunk.com/t5/Splunk-Search/transaction-duration-between-subevents/m-p/53698#M13061</link>
      <description>&lt;P&gt;Hmm, you cant use &lt;CODE&gt;_time&lt;/CODE&gt; after the transaction, so you must make an eval before the transaction, in order to preserve the timestamp for each subevent in a multivalued field.&lt;/P&gt;

&lt;P&gt;...| eval sub_time = _time |&lt;/P&gt;</description>
      <pubDate>Tue, 03 Sep 2013 17:09:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/transaction-duration-between-subevents/m-p/53698#M13061</guid>
      <dc:creator>kristian_kolb</dc:creator>
      <dc:date>2013-09-03T17:09:36Z</dc:date>
    </item>
    <item>
      <title>Re: transaction duration between subevents</title>
      <link>https://community.splunk.com/t5/Splunk-Search/transaction-duration-between-subevents/m-p/53699#M13062</link>
      <description>&lt;P&gt;I am not sure that you need the transaction command. The following&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=citrix source="C:\Temp\tslogon_log.txt"
| sort  UserName host _time
| delta _time as StepTime p=1
| eval Step=case(searchmatch("STARTED"),null(),
            searchmatch("Step1_Complete"),1
            searchmatch("Step2_Complete"),2
            searchmatch("Step3_Complete"),3
            searchmatch("Step4_Complete"),4
            searchmatch("FINISH"),5
            1=1,null())
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;will create two new fields StepTime and Step, which can be used in a variety of ways&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| stats avg(StepTime) as AverageStepTime by Step
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;or&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| stats avg(StepTime) as StepTime by User Host Step
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This solution requires that every "transaction" must have all of the components. It is okay if a transaction is in progress, as it will only calculate the completed steps. However, if the START is not logged or a step is not logged, then it may not work properly.&lt;/P&gt;</description>
      <pubDate>Thu, 05 Sep 2013 00:10:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/transaction-duration-between-subevents/m-p/53699#M13062</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2013-09-05T00:10:10Z</dc:date>
    </item>
  </channel>
</rss>

