<?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: Calculate total duration when many transactions are overlap in the time in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Calculate-total-duration-when-many-transactions-are-overlap-in/m-p/545311#M154433</link>
    <description>&lt;P&gt;Here is an example of two transactions and underlined in blue which allows me to differentiate them&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="wcastillocruz_0-1616665472529.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/13480i8DE5EA94B7680A32/image-dimensions/400x46?v=v2" width="400" height="46" role="button" title="wcastillocruz_0-1616665472529.png" alt="wcastillocruz_0-1616665472529.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 25 Mar 2021 09:46:37 GMT</pubDate>
    <dc:creator>wcastillocruz</dc:creator>
    <dc:date>2021-03-25T09:46:37Z</dc:date>
    <item>
      <title>Calculate total duration when many transactions are overlap in the time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Calculate-total-duration-when-many-transactions-are-overlap-in/m-p/545103#M154362</link>
      <description>&lt;P&gt;Hello dear community,&lt;BR /&gt;help me on this issue please.&lt;BR /&gt;When using the concurrency command to find out if transactions overlap in time, and if so, is it possible to calculate the total duration of the incident taking the overlap into account.&lt;/P&gt;&lt;P&gt;for example :&lt;/P&gt;&lt;P&gt;transaction 1:&lt;BR /&gt;start -&amp;gt; 10 a.m.&lt;BR /&gt;end -&amp;gt; 11 a.m.&lt;/P&gt;&lt;P&gt;Transaction 2:&lt;BR /&gt;start -&amp;gt; 10:30 am&lt;BR /&gt;end -&amp;gt; 11:30 am&lt;/P&gt;&lt;P&gt;transaction 1 concerns process1 and transaction 2 concern porcess2 but the two transactions correspond to the same application X&lt;/P&gt;&lt;P&gt;before, to calculate the total duration of the incident on application X&lt;BR /&gt;I added the duration of transaction 1 + the duration of transaction 2.&lt;BR /&gt;this is the correct way when incidents (transactions) do not overlap, but when they overlap as in the previous example. the total incident duration of the application is equal to 1h30 and not to 2h.&lt;/P&gt;&lt;P&gt;using concurrency command can we calculate this duration?&lt;/P&gt;</description>
      <pubDate>Wed, 24 Mar 2021 11:50:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Calculate-total-duration-when-many-transactions-are-overlap-in/m-p/545103#M154362</guid>
      <dc:creator>wcastillocruz</dc:creator>
      <dc:date>2021-03-24T11:50:06Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate total duration when many transactions are overlap in the time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Calculate-total-duration-when-many-transactions-are-overlap-in/m-p/545178#M154387</link>
      <description>&lt;P&gt;Can you identify which message belongs to which transaction? If so, you can "group" the events by that identifier and determine your duration from that.&lt;/P&gt;&lt;P&gt;for example :&lt;/P&gt;&lt;P&gt;10 a.m transaction 1 start&lt;BR /&gt;10:30 a.m transaction 2 start&lt;BR /&gt;11 a.m transaction 1&amp;nbsp;end&lt;BR /&gt;11:30 a.m transaction 2&amp;nbsp;end&lt;/P&gt;</description>
      <pubDate>Wed, 24 Mar 2021 15:46:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Calculate-total-duration-when-many-transactions-are-overlap-in/m-p/545178#M154387</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2021-03-24T15:46:21Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate total duration when many transactions are overlap in the time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Calculate-total-duration-when-many-transactions-are-overlap-in/m-p/545293#M154425</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;,&lt;BR /&gt;Thank you for your answer.&lt;/P&gt;&lt;P&gt;yes, I can identify each transaction with a unique ID.&lt;BR /&gt;I'm already doing this. or do you mean to combine my two transactions into one?&lt;/P&gt;</description>
      <pubDate>Thu, 25 Mar 2021 08:41:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Calculate-total-duration-when-many-transactions-are-overlap-in/m-p/545293#M154425</guid>
      <dc:creator>wcastillocruz</dc:creator>
      <dc:date>2021-03-25T08:41:37Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate total duration when many transactions are overlap in the time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Calculate-total-duration-when-many-transactions-are-overlap-in/m-p/545294#M154426</link>
      <description>&lt;P&gt;How do you know that transaction 1 and transaction 2 are part of the same incident?&lt;/P&gt;&lt;P&gt;If I understand correctly, you want the time between first start (10 am) and last end (11:30 am), is that right?&lt;/P&gt;&lt;P&gt;If the first transaction finished at 11 am and the second one started at 12pm, both transactions taking an hour, would you want the duration to be 2 hours or 3 hours?&lt;/P&gt;</description>
      <pubDate>Thu, 25 Mar 2021 08:51:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Calculate-total-duration-when-many-transactions-are-overlap-in/m-p/545294#M154426</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2021-03-25T08:51:32Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate total duration when many transactions are overlap in the time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Calculate-total-duration-when-many-transactions-are-overlap-in/m-p/545302#M154427</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;,&lt;BR /&gt;Thanks again for your reply.&lt;/P&gt;&lt;P&gt;well,&lt;BR /&gt;I identify each transaction thanks to a series of data that each transaction contains.&lt;BR /&gt;this is the start of my search:&lt;BR /&gt;&lt;BR /&gt;index = index1&lt;BR /&gt;| eval ID = Service + "_" + Env + "_" + Apps + "_" + Function&lt;BR /&gt;| addinfo&lt;BR /&gt;| transaction ID startswith = (severity = 2) endswith = (severity = 0 OR severity = 1 OR severity = -1) maxevents = 4&lt;/P&gt;&lt;P&gt;"&lt;SPAN&gt;If I understand correctly, you want the time &lt;STRONG&gt;between first start (10 am) and last end (11:30 am)&lt;/STRONG&gt;, is that right?"&lt;/SPAN&gt;&lt;BR /&gt;yes, at this time the duration of the incident for the Application is 1:30 hour.&lt;/P&gt;&lt;P&gt;but if&lt;BR /&gt;transaction 1 =&lt;BR /&gt;start 10:00 AM&lt;BR /&gt;end 11:00 AM&lt;/P&gt;&lt;P&gt;transaction 2 =&lt;BR /&gt;start 11:00 AM&lt;BR /&gt;end 12:00 PM&lt;BR /&gt;&lt;BR /&gt;in this case the duration is equal to the sum of the duration transaction 1 + duration transaction 2&lt;BR /&gt;note: I have several Applications, and my ID allows me to separate transactions.&lt;/P&gt;</description>
      <pubDate>Thu, 25 Mar 2021 09:16:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Calculate-total-duration-when-many-transactions-are-overlap-in/m-p/545302#M154427</guid>
      <dc:creator>wcastillocruz</dc:creator>
      <dc:date>2021-03-25T09:16:11Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate total duration when many transactions are overlap in the time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Calculate-total-duration-when-many-transactions-are-overlap-in/m-p/545304#M154428</link>
      <description>&lt;P&gt;that explains better than me &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="wcastillocruz_0-1616664266345.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/13479i4C4BFC9675F859F1/image-size/medium?v=v2&amp;amp;px=400" role="button" title="wcastillocruz_0-1616664266345.png" alt="wcastillocruz_0-1616664266345.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Mar 2021 09:25:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Calculate-total-duration-when-many-transactions-are-overlap-in/m-p/545304#M154428</guid>
      <dc:creator>wcastillocruz</dc:creator>
      <dc:date>2021-03-25T09:25:13Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate total duration when many transactions are overlap in the time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Calculate-total-duration-when-many-transactions-are-overlap-in/m-p/545305#M154429</link>
      <description>&lt;P&gt;It is still not clear what ties transaction 1 to transaction 2. Suppose there was a third transaction (transaction 3) which was part of a different "incident". How would you know whether to consider the start of transaction 1 and the end of transaction 2, or the start of transaction 1 and the end of transaction 3?&lt;/P&gt;</description>
      <pubDate>Thu, 25 Mar 2021 09:26:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Calculate-total-duration-when-many-transactions-are-overlap-in/m-p/545305#M154429</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2021-03-25T09:26:26Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate total duration when many transactions are overlap in the time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Calculate-total-duration-when-many-transactions-are-overlap-in/m-p/545307#M154431</link>
      <description>&lt;P&gt;That looks like you want the first message from Application A and the last message from Application A. Can an application handle more than one incident? Do you need to be able to distinguish between the incidents an application is handling? How would you do this?&lt;/P&gt;</description>
      <pubDate>Thu, 25 Mar 2021 09:33:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Calculate-total-duration-when-many-transactions-are-overlap-in/m-p/545307#M154431</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2021-03-25T09:33:53Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate total duration when many transactions are overlap in the time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Calculate-total-duration-when-many-transactions-are-overlap-in/m-p/545311#M154433</link>
      <description>&lt;P&gt;Here is an example of two transactions and underlined in blue which allows me to differentiate them&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="wcastillocruz_0-1616665472529.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/13480i8DE5EA94B7680A32/image-dimensions/400x46?v=v2" width="400" height="46" role="button" title="wcastillocruz_0-1616665472529.png" alt="wcastillocruz_0-1616665472529.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Mar 2021 09:46:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Calculate-total-duration-when-many-transactions-are-overlap-in/m-p/545311#M154433</guid>
      <dc:creator>wcastillocruz</dc:creator>
      <dc:date>2021-03-25T09:46:37Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate total duration when many transactions are overlap in the time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Calculate-total-duration-when-many-transactions-are-overlap-in/m-p/545314#M154436</link>
      <description>&lt;LI-CODE lang="markup"&gt;index = index1
| eval IncidentID = Service + "_" + Env + "_" + Apps
| stats first(_time) as start last(_time) as end by IncidentID
| eval duration=end-start&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 25 Mar 2021 09:51:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Calculate-total-duration-when-many-transactions-are-overlap-in/m-p/545314#M154436</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2021-03-25T09:51:47Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate total duration when many transactions are overlap in the time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Calculate-total-duration-when-many-transactions-are-overlap-in/m-p/545328#M154439</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;it is not as easy as it may seem.&lt;BR /&gt;I have listed several months of events, this is not a specific case.&lt;BR /&gt;moreover I can index several events for the same application in a day, and it is possible that these events do not overlap and which do not follow one another.&lt;/P&gt;&lt;P&gt;by following your solution I get this:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="wcastillocruz_1-1616668116901.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/13482i6874CE3AC4BB8604/image-size/medium?v=v2&amp;amp;px=400" role="button" title="wcastillocruz_1-1616668116901.png" alt="wcastillocruz_1-1616668116901.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;while for application A for example, nothing happened between 1:00 p.m. and 2:00 p.m. and with your solution I add this time to my total incident duration&lt;/P&gt;&lt;P&gt;thank you very much anyway.&lt;/P&gt;</description>
      <pubDate>Thu, 25 Mar 2021 10:29:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Calculate-total-duration-when-many-transactions-are-overlap-in/m-p/545328#M154439</guid>
      <dc:creator>wcastillocruz</dc:creator>
      <dc:date>2021-03-25T10:29:49Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate total duration when many transactions are overlap in the time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Calculate-total-duration-when-many-transactions-are-overlap-in/m-p/545339#M154444</link>
      <description>&lt;P&gt;OK I got it - I had misread your first graphic. Yes, it is a bit more complicated.&lt;/P&gt;</description>
      <pubDate>Thu, 25 Mar 2021 10:46:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Calculate-total-duration-when-many-transactions-are-overlap-in/m-p/545339#M154444</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2021-03-25T10:46:59Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate total duration when many transactions are overlap in the time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Calculate-total-duration-when-many-transactions-are-overlap-in/m-p/545350#M154446</link>
      <description>&lt;P&gt;it's not you but me who explains badly&lt;BR /&gt;&lt;BR /&gt;Thank a lot&lt;/P&gt;</description>
      <pubDate>Thu, 25 Mar 2021 11:06:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Calculate-total-duration-when-many-transactions-are-overlap-in/m-p/545350#M154446</guid>
      <dc:creator>wcastillocruz</dc:creator>
      <dc:date>2021-03-25T11:06:02Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate total duration when many transactions are overlap in the time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Calculate-total-duration-when-many-transactions-are-overlap-in/m-p/545354#M154448</link>
      <description>&lt;LI-CODE lang="markup"&gt;| makeresults | eval _raw="time,application,transaction,action
10:00,A,1,start
12:00,A,1,end
11:00,A,2,start
13:00,A,2,end
15:00,A,3,start
17:00,A,3,end
10:00,B,1,start
12:00,B,1,end
13:00,B,2,start
15:00,B,2,end
16:00,B,3,start
18:00,B,3,end"
| multikv forceheader=1
| fields - _time _raw linecount
| eval _time=strptime(strftime(now(),"%Y/%m/%d")."T".time.":00","%Y/%m/%dT%H:%M:%S")
| fields - time
| sort application _time
| eval process=if(action="start",1,-1)
| streamstats sum(process) as concurrent by application
| eval starttime=if(concurrent=1 AND process=1,_time,null)
| eval endtime=if(concurrent=0 AND process=-1,_time,null)
| filldown starttime
| eval duration=endtime-starttime
| stats sum(duration) as duration by application
| eval duration=tostring(duration,"duration")&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 25 Mar 2021 11:11:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Calculate-total-duration-when-many-transactions-are-overlap-in/m-p/545354#M154448</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2021-03-25T11:11:03Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate total duration when many transactions are overlap in the time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Calculate-total-duration-when-many-transactions-are-overlap-in/m-p/545357#M154450</link>
      <description>&lt;P&gt;Essentially, use streamstats to keep a running total of active processes, note when the first of an overlapping set starts and when the last of the overlapping set ends, then find the difference and add all the differences to give a total processing time&lt;/P&gt;</description>
      <pubDate>Thu, 25 Mar 2021 11:13:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Calculate-total-duration-when-many-transactions-are-overlap-in/m-p/545357#M154450</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2021-03-25T11:13:48Z</dc:date>
    </item>
  </channel>
</rss>

