<?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: Splunk Query to get time taken by each application in a transaction in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Splunk-Query-to-get-time-taken-by-each-application-in-a/m-p/462368#M130345</link>
    <description>&lt;P&gt;Thanks Ololdash for the response. In my case, I have the Transaction Id present in all events(PFB the event sample(created based on original events) in the link, not able to upload image file), . I am just checking ,is there any option to get the time spend in each application for each flow for the transaction (for example looking for a separate entry for the time taken in app1 before app2 started processing and the time taken in app1 when app1 get the final result from app2 etc.,)&lt;/P&gt;

&lt;P&gt;&lt;A href="https://photos.app.goo.gl/DSwpLzyfdRYGbPLo6"&gt;https://photos.app.goo.gl/DSwpLzyfdRYGbPLo6&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;example of result expecting is someting like&lt;/P&gt;

&lt;P&gt;each number below is a column(excuse me for the formatting issue)&lt;BR /&gt;
   &lt;STRONG&gt;1.app1(Flow1) Start time  2.app1(Flow1) End time  3.app2(FLow1)Start Time   4.app2(flow1) End Time ............. &lt;BR /&gt;
  5. app1(flow2)start time   6.app1(flow2) End TIme&lt;/STRONG&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 19 Dec 2019 23:05:30 GMT</pubDate>
    <dc:creator>jyothishtj</dc:creator>
    <dc:date>2019-12-19T23:05:30Z</dc:date>
    <item>
      <title>Splunk Query to get time taken by each application in a transaction</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-Query-to-get-time-taken-by-each-application-in-a/m-p/462365#M130342</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;

&lt;P&gt;I am new to splunk. I got a transaction which is flowing through multiple applications. I got a requirement to find out the time taken in each application for the transaction. The logs from all the application contains the same "transaction_id". The log entry from each application will contain a seprate index(e.g, for app1 &lt;STRONG&gt;&lt;EM&gt;app1_index&lt;/EM&gt;&lt;/STRONG&gt;, for app2 &lt;STRONG&gt;&lt;EM&gt;app2_index&lt;/EM&gt;&lt;/STRONG&gt;,for app3*&lt;STRONG&gt;app3_index&lt;/STRONG&gt;* etc.,)&lt;/P&gt;

&lt;P&gt;the flow will be like app1-&amp;gt;app2-&amp;gt;app3-&amp;gt;app2-&amp;gt;app1.&lt;/P&gt;

&lt;P&gt;I am looking for a splunk query to identify the time taken by app1(the time between 1st entry of app1_index and last entry of app1_index in the intial flow from app1-&amp;gt;app2). The problem here is that more than one entry will be present for each application(for example in app1-&amp;gt;app2 will have an entry for app1 and app2-&amp;gt; app1 will have an entry).&lt;/P&gt;

&lt;P&gt;I was trying to use the "transaction" for this. But when using transaction along with the index field, I can get only the transaction with the same index start and end. But in my case there will be 2 flow with the same index. &lt;BR /&gt;
 Is there any way to achieve this requirement?. Can you please help here. Any pointer will be appreciated.&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 03:19:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-Query-to-get-time-taken-by-each-application-in-a/m-p/462365#M130342</guid>
      <dc:creator>jyothishtj</dc:creator>
      <dc:date>2020-09-30T03:19:51Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk Query to get time taken by each application in a transaction</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-Query-to-get-time-taken-by-each-application-in-a/m-p/462366#M130343</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I assume, that the transaction_id is unique and will identify all events that are connected with the transaction. With this assumption I suggest something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;your search to get all the events from one or multiple indexes&amp;gt; | stats earliest(_time) as start_time, latest(_time) as end_time by transaction_id | eval time_used=end_time-start_time
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This will get you a field &lt;CODE&gt;time_used&lt;/CODE&gt; that holds the time between the first event and the last event in seconds. If you want to get the time over multiple transaction_id values, you would probably do something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;your search to get all the events from one or multiple indexes&amp;gt;
| eval key=[&amp;lt;subsearch to produce transaction_id #1&amp;gt;| return $transaction_id].[&amp;lt;subsearch to produce transaction_id #2&amp;gt;| return $transaction_id]
| stats values(transaction_id) as transactions, earliest(_time) as start_time, latest(_time) as end_time by key
| eval time_used=end_time-start_time | fields - key
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 16 Dec 2019 14:00:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-Query-to-get-time-taken-by-each-application-in-a/m-p/462366#M130343</guid>
      <dc:creator>ololdach</dc:creator>
      <dc:date>2019-12-16T14:00:34Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk Query to get time taken by each application in a transaction</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-Query-to-get-time-taken-by-each-application-in-a/m-p/462367#M130344</link>
      <description>&lt;P&gt;Show us sample event data and a mockup of the desired final output FOR THOSE EVENTS.&lt;/P&gt;</description>
      <pubDate>Mon, 16 Dec 2019 17:19:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-Query-to-get-time-taken-by-each-application-in-a/m-p/462367#M130344</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-12-16T17:19:11Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk Query to get time taken by each application in a transaction</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-Query-to-get-time-taken-by-each-application-in-a/m-p/462368#M130345</link>
      <description>&lt;P&gt;Thanks Ololdash for the response. In my case, I have the Transaction Id present in all events(PFB the event sample(created based on original events) in the link, not able to upload image file), . I am just checking ,is there any option to get the time spend in each application for each flow for the transaction (for example looking for a separate entry for the time taken in app1 before app2 started processing and the time taken in app1 when app1 get the final result from app2 etc.,)&lt;/P&gt;

&lt;P&gt;&lt;A href="https://photos.app.goo.gl/DSwpLzyfdRYGbPLo6"&gt;https://photos.app.goo.gl/DSwpLzyfdRYGbPLo6&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;example of result expecting is someting like&lt;/P&gt;

&lt;P&gt;each number below is a column(excuse me for the formatting issue)&lt;BR /&gt;
   &lt;STRONG&gt;1.app1(Flow1) Start time  2.app1(Flow1) End time  3.app2(FLow1)Start Time   4.app2(flow1) End Time ............. &lt;BR /&gt;
  5. app1(flow2)start time   6.app1(flow2) End TIme&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Dec 2019 23:05:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-Query-to-get-time-taken-by-each-application-in-a/m-p/462368#M130345</guid>
      <dc:creator>jyothishtj</dc:creator>
      <dc:date>2019-12-19T23:05:30Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk Query to get time taken by each application in a transaction</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-Query-to-get-time-taken-by-each-application-in-a/m-p/462369#M130346</link>
      <description>&lt;P&gt;Hi Woodcock,&lt;/P&gt;

&lt;P&gt;PFB the link with sample event details(created a mock up screenshot as the original one is sensitive data)&lt;/P&gt;

&lt;P&gt;&lt;A href="https://photos.app.goo.gl/DSwpLzyfdRYGbPLo6"&gt;https://photos.app.goo.gl/DSwpLzyfdRYGbPLo6&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;I have the Transaction Id present in all events in the link, not able to upload image file, . I am just checking ,is there any option to get the time spend in each application for each flow for the transaction (for example looking for a separate entry for the time taken in app1 before app2 started processing and the time taken in app1 when app1 get the final result from app2 etc.,)&lt;BR /&gt;
The expected result is something like .. each entry is the column name(excuse me for the formatting)&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;1.app1(Flow1) Start time 2.app1(Flow1) End time 3.app2(FLow1)Start Time 4.app2(flow1) End Time .............&lt;BR /&gt;
5. app1(flow2)start time 6.app1(flow2) End TIme&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Dec 2019 23:23:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-Query-to-get-time-taken-by-each-application-in-a/m-p/462369#M130346</guid>
      <dc:creator>jyothishtj</dc:creator>
      <dc:date>2019-12-19T23:23:33Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk Query to get time taken by each application in a transaction</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-Query-to-get-time-taken-by-each-application-in-a/m-p/462370#M130347</link>
      <description>&lt;P&gt;Transaction ID is NOT Unique?&lt;/P&gt;</description>
      <pubDate>Fri, 20 Dec 2019 14:00:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-Query-to-get-time-taken-by-each-application-in-a/m-p/462370#M130347</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2019-12-20T14:00:17Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk Query to get time taken by each application in a transaction</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-Query-to-get-time-taken-by-each-application-in-a/m-p/462371#M130348</link>
      <description>&lt;P&gt;Transaction ID is unique and same in all the events for a transaction. But, I am trying to find out the time each application spend for each flow in the transaction. Actually the flow is mentioned as transaction1 ,transaction2 etc., in the image.&lt;/P&gt;

&lt;P&gt;&lt;A href="https://photos.app.goo.gl/DSwpLzyfdRYGbPLo6"&gt;https://photos.app.goo.gl/DSwpLzyfdRYGbPLo6&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Hope I am not creating confusion.&lt;/P&gt;</description>
      <pubDate>Sun, 22 Dec 2019 22:45:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-Query-to-get-time-taken-by-each-application-in-a/m-p/462371#M130348</guid>
      <dc:creator>jyothishtj</dc:creator>
      <dc:date>2019-12-22T22:45:43Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk Query to get time taken by each application in a transaction</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-Query-to-get-time-taken-by-each-application-in-a/m-p/462372#M130349</link>
      <description>&lt;PRE&gt;&lt;CODE&gt; &amp;lt;your search to get all the events from one or multiple indexes&amp;gt; 
| reverse
| streamstats range(_time) as duration by transaction_id index
| rename COMMENT as "untill here, duration of each flow by transaction id"
| rename COMMENT as "from here, duration of total flow by transaction id"
| stats sum(duration) as duration by transaciotn_id
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Hi, @jyothishtj &lt;BR /&gt;
The unit is seconds.&lt;/P&gt;</description>
      <pubDate>Sun, 22 Dec 2019 23:51:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-Query-to-get-time-taken-by-each-application-in-a/m-p/462372#M130349</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2019-12-22T23:51:36Z</dc:date>
    </item>
  </channel>
</rss>

