<?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 find the duration of individual steps in a transaction search? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-find-the-duration-of-individual-steps-in-a-transaction/m-p/300631#M90516</link>
    <description>&lt;P&gt;Ok.. the transaction command is sorting both the mv field, so the order is skewed. You basically need to merge stepduration calculation logic of option 3 with transaction calculation of option 2. Like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;** my search ** | sort 0 callback _time | streamstats current=f window=1 valeus(_time) as prev_time by callback | eval stepduration=coalesce(_time-prev_time,"NA") | | stats min(_time) as start list(stepId) as stepId list(stepduration ) as stepduration max(_time) as end by callback | eval duration=end-_time | table callback stepId stepduration duration
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 15 Feb 2017 21:13:04 GMT</pubDate>
    <dc:creator>somesoni2</dc:creator>
    <dc:date>2017-02-15T21:13:04Z</dc:date>
    <item>
      <title>How to find the duration of individual steps in a transaction search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-find-the-duration-of-individual-steps-in-a-transaction/m-p/300626#M90511</link>
      <description>&lt;P&gt;Hi, I need to find the duration taken by each step of a single transaction.&lt;/P&gt;

&lt;P&gt;We are trying to find out the duration of individual &lt;STRONG&gt;"StepId" ** within a single transaction all joined by **"callback"&lt;/STRONG&gt; field - i.e there are multiple &lt;STRONG&gt;"stepId"&lt;/STRONG&gt; all joined by a single ** "Callback"**&lt;/P&gt;

&lt;P&gt;I am trying the below search&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;** my search **| transaction callback | table callback stepId duration
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I am getting the result as cumulative duration of all the steps as a single field - Is there a way to get the duration of individual stepId's?&lt;/P&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/2490iD52152061AF8DDDD/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt; &lt;/P&gt;

&lt;P&gt;Below is my Sample Log&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;10.136.180.249 - - [15/Feb/2017:10:59:59 -0500] "GET /SampleUI/step?stepId=GUID-4-9D91BA9AE27F4EA69856B99F090EC365&amp;amp;amp;sessionId=31474be3-b803-4d71-999f-8fb17c63cb73&amp;amp;amp;displayFormReferenceKey=5e1d1521-932a-4378-a4f3-7628031739f5&amp;amp;amp;sourceUrl=undefined&amp;amp;amp;callback=jQuery1112045955571818351104_1487174397781&amp;amp;amp;_=148717439778 HTTP/1.1" 200 986

10.136.180.249 - - [15/Feb/2017:11:01:03 -0500] "GET /SampleUI/step?stepId=GUID-27-4ABE861B01EB42AAAE034A863CC5A2EE&amp;amp;amp;sessionId=31474be3-b803-4d71-999f-8fb17c63cb73&amp;amp;amp;displayFormReferenceKey=0b8de127-b24d-4ffd-8930-60c3916ce1d0&amp;amp;amp;sourceUrl=undefined&amp;amp;amp;callback=jQuery1112045955571818351104_1487174397781&amp;amp;amp;_=14871743977 HTTP/1.1" 200 3747

10.136.180.249 - - [15/Feb/2017:11:01:05 -0500] "GET /SampleUI/step?stepId=GUID-30-2D27398D62624694849559DDC3C49090&amp;amp;amp;sessionId=31474be3-b803-4d71-999f-8fb17c63cb73&amp;amp;amp;displayFormReferenceKey=e125423c-2ae3-42c6-bcde-acc96255f702&amp;amp;amp;sourceUrl=undefined&amp;amp;amp;callback=jQuery1112045955571818351104_1487174397781&amp;amp;amp;_=14871743977 HTTP/1.1" 200 1628 

10.136.180.249 - - [15/Feb/2017:11:01:06 -0500] "GET /SampleUI/step?stepId=GUID-33-D0987CBE8DAF422A9A71174DFDEF0CF4&amp;amp;amp;sessionId=31474be3-b803-4d71-999f-8fb17c63cb73&amp;amp;amp;displayFormReferenceKey=f5cd1b64-99ea-4637-a9d4-beae474ed4a5&amp;amp;amp;sourceUrl=undefined&amp;amp;amp;callback=jQuery1112045955571818351104_1487174397781&amp;amp;amp;_=14871743977 HTTP/1.1" 200 362
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 15 Feb 2017 18:54:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-find-the-duration-of-individual-steps-in-a-transaction/m-p/300626#M90511</guid>
      <dc:creator>writetosathya</dc:creator>
      <dc:date>2017-02-15T18:54:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to find the duration of individual steps in a transaction search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-find-the-duration-of-individual-steps-in-a-transaction/m-p/300627#M90512</link>
      <description>&lt;P&gt;Give this a try&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Fixed type&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;** my search ** | sort 0 callback _time | delta _time as stepduration | fillnull value="NA" stepduration | transaction callback | table callback stepId stepduration duration
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;OR (may be faster)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;** my search ** | sort 0 callback _time | delta _time as stepduration | stats min(_time) as start list(stepId) as stepId list(stepduration ) as stepduration max(_time) as end by callback | eval duration=end-_time | table callback stepId stepduration duration
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;STRONG&gt;Updated&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;Try this &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;** my search ** | sort 0 callback _time | streamstats current=f window=1 valeus(_time) as prev_time by callback | eval stepduration=_time-prev_time | transaction callback | table callback stepId stepduration duration
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 15 Feb 2017 19:18:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-find-the-duration-of-individual-steps-in-a-transaction/m-p/300627#M90512</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-02-15T19:18:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to find the duration of individual steps in a transaction search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-find-the-duration-of-individual-steps-in-a-transaction/m-p/300628#M90513</link>
      <description>&lt;P&gt;Hi Somesh,&lt;/P&gt;

&lt;P&gt;Thanks for the quick reply - I tried out both approaches however I am still getting the values in the same format where the duration value is aggregated for all the stepsID's - I wanted to see if we can calculate duration of each of step ID's &lt;/P&gt;

&lt;P&gt;Tried doing a transaction with both fields like&lt;/P&gt;

&lt;P&gt;** my search **| transaction callback stepId | table callback stepId duration - does not work as well&lt;/P&gt;

&lt;P&gt;can you please guide?&lt;/P&gt;</description>
      <pubDate>Wed, 15 Feb 2017 19:42:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-find-the-duration-of-individual-steps-in-a-transaction/m-p/300628#M90513</guid>
      <dc:creator>writetosathya</dc:creator>
      <dc:date>2017-02-15T19:42:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to find the duration of individual steps in a transaction search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-find-the-duration-of-individual-steps-in-a-transaction/m-p/300629#M90514</link>
      <description>&lt;P&gt;The first option has a missing stepduration field in the last table. I've updated it so try again.&lt;/P&gt;

&lt;P&gt;Also try the 3rd option that I put. If it still doesn't work, tell me if you see valid values in the field stepduration for following query.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;** my search ** | table _time callback stepId | sort 0 callback _time | streamstats current=f window=1 valeus(_time) as prev_time by callback | eval stepduration=_time-prev_time 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 15 Feb 2017 19:48:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-find-the-duration-of-individual-steps-in-a-transaction/m-p/300629#M90514</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-02-15T19:48:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to find the duration of individual steps in a transaction search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-find-the-duration-of-individual-steps-in-a-transaction/m-p/300630#M90515</link>
      <description>&lt;P&gt;Somesh,&lt;/P&gt;

&lt;P&gt;Thanks a lot for your valuable time - I really appreciate it! - I am getting the split now&lt;/P&gt;

&lt;P&gt;There seems to be a data mismatch though- This is the result set I am getting from the query&lt;/P&gt;

&lt;P&gt;GUID-27-4ABE861B01EB42AAAE034A863CC5A2EE      ---           1&lt;BR /&gt;
GUID-30-2D27398D62624694849559DDC3C49090       ---         2&lt;BR /&gt;
GUID-33-D0987CBE8DAF422A9A71174DFDEF0CF4           ---      64&lt;BR /&gt;
GUID-4-9D91BA9AE27F4EA69856B99F090EC365 &lt;/P&gt;

&lt;P&gt;However the time duration if I do a manual calculation is &lt;/P&gt;

&lt;P&gt;GUID-33-D0987CBE8DAF422A9A71174DFDEF0CF4&lt;BR /&gt;&lt;BR /&gt;
GUID-27-4ABE861B01EB42AAAE034A863CC5A2EE       ---            2&lt;BR /&gt;
GUID-30-2D27398D62624694849559DDC3C49090          ---          1&lt;BR /&gt;
GUID-4-9D91BA9AE27F4EA69856B99F090EC365                 ---    64&lt;/P&gt;

&lt;P&gt;As this is a web access log and hence the times we have captured as stepduration is  actually be  the time for the step immediately previous to that . &lt;/P&gt;

&lt;P&gt;I understand that you have already given your valuable time  so I will  try my best to figure what could be skewing the results I am a splunk newbie &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;  .&lt;/P&gt;

&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Wed, 15 Feb 2017 21:04:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-find-the-duration-of-individual-steps-in-a-transaction/m-p/300630#M90515</guid>
      <dc:creator>writetosathya</dc:creator>
      <dc:date>2017-02-15T21:04:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to find the duration of individual steps in a transaction search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-find-the-duration-of-individual-steps-in-a-transaction/m-p/300631#M90516</link>
      <description>&lt;P&gt;Ok.. the transaction command is sorting both the mv field, so the order is skewed. You basically need to merge stepduration calculation logic of option 3 with transaction calculation of option 2. Like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;** my search ** | sort 0 callback _time | streamstats current=f window=1 valeus(_time) as prev_time by callback | eval stepduration=coalesce(_time-prev_time,"NA") | | stats min(_time) as start list(stepId) as stepId list(stepduration ) as stepduration max(_time) as end by callback | eval duration=end-_time | table callback stepId stepduration duration
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 15 Feb 2017 21:13:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-find-the-duration-of-individual-steps-in-a-transaction/m-p/300631#M90516</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-02-15T21:13:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to find the duration of individual steps in a transaction search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-find-the-duration-of-individual-steps-in-a-transaction/m-p/300632#M90517</link>
      <description>&lt;P&gt;Hi somesh,&lt;/P&gt;

&lt;P&gt;Thanks for your help again- This one worked &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;Again appeciate your guidance,&lt;/P&gt;</description>
      <pubDate>Thu, 16 Feb 2017 19:35:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-find-the-duration-of-individual-steps-in-a-transaction/m-p/300632#M90517</guid>
      <dc:creator>writetosathya</dc:creator>
      <dc:date>2017-02-16T19:35:24Z</dc:date>
    </item>
  </channel>
</rss>

