<?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: Need to print response time of request in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/Need-to-print-response-time-of-request/m-p/456509#M41120</link>
    <description>&lt;P&gt;hello there, &lt;/P&gt;

&lt;P&gt;as @skoelpin suggested, a unique identifier will help you to tie the events together.&lt;BR /&gt;
i mimicked an identifier for the following example, after the &lt;CODE&gt;Summary(TransactionId-)&lt;/CODE&gt; in this case &lt;CODE&gt;Summary(TransactionId-123)&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;try the following search anywhere:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults count=1 
| eval data = "24-07-2018 09:41:47:111 [RetrieveInterestRate][INFO ]: |BEM_Gateway_Request_MF Request Processing Summary(TransactionId-123) SCVT Recieved Request at 24-07-2018 09:41:47:108
; 24-07-2018 09:41:47:239 [RetrieveInterestRate][INFO ]: |BEM_Gateway_Response_MF Request Processing Summary(TransactionId-123) SCVT sent response back to consumer at 24-07-2018 09:41:47:236"
| makemv delim=";" data 
| mvexpand data
| rex field=data "SCVT\s+(?&amp;lt;request_or_response&amp;gt;[^\s]+).+at\s+(?&amp;lt;time&amp;gt;\d{2}\-\d{2}\-\d{4}\s+\d{2}\:\d{2}\:\d{2}\:\d{3})"
| rex field=data "TransactionId\-(?&amp;lt;transaction_id&amp;gt;\S+)\)"
| eval time_epoch = strptime(time, "%d-%m-%Y %H:%M:%S:%3N")
| eval recieved_time = if(request_or_response="Recieved",time_epoch,null())
| eval response_time = if(request_or_response="sent",time_epoch,null())
| stats values(recieved_time) as rec_time values(response_time) as res_time by transaction_id
| eval duration_in_seconds = res_time - rec_time
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;hope it helps&lt;/P&gt;</description>
    <pubDate>Tue, 24 Jul 2018 14:30:35 GMT</pubDate>
    <dc:creator>adonio</dc:creator>
    <dc:date>2018-07-24T14:30:35Z</dc:date>
    <item>
      <title>Need to print response time of request</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Need-to-print-response-time-of-request/m-p/456507#M41118</link>
      <description>&lt;P&gt;Hi ,&lt;/P&gt;

&lt;P&gt;I want create one table of three columns like below&lt;BR /&gt;
Request_time     Response_time     Difference(Response_time - Request_time )&lt;BR /&gt;
And my application logs are printed in below manner.&lt;/P&gt;

&lt;P&gt;24-07-2018 09:41:47:111 [RetrieveInterestRate][INFO ]: |BEM_Gateway_Request_MF Request Processing Summary(TransactionId-**************&lt;STRONG&gt;&lt;EM&gt;) SCVT Recieved Request at 24-07-2018 09:41:47:108&lt;BR /&gt;
24-07-2018 09:41:47:239 [RetrieveInterestRate][INFO ]: |BEM_Gateway_Response_MF Request Processing Summary(TransactionId-&lt;/EM&gt;&lt;/STRONG&gt;**************) SCVT sent response back to consumer at 24-07-2018 09:41:47:236&lt;/P&gt;

&lt;P&gt;Here request time printed after SCVT Recieved Request at  and response time printed after SCVT sent response back to consumer at&lt;BR /&gt;
SO can please help here ?&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 20:35:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Need-to-print-response-time-of-request/m-p/456507#M41118</guid>
      <dc:creator>ajaynaralikar</dc:creator>
      <dc:date>2020-09-29T20:35:55Z</dc:date>
    </item>
    <item>
      <title>Re: Need to print response time of request</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Need-to-print-response-time-of-request/m-p/456508#M41119</link>
      <description>&lt;P&gt;Do you have a unique identifier that ties the request and response together? If so then you can tie these together and use a simple &lt;CODE&gt;eval&lt;/CODE&gt; to do the math&lt;/P&gt;</description>
      <pubDate>Tue, 24 Jul 2018 14:10:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Need-to-print-response-time-of-request/m-p/456508#M41119</guid>
      <dc:creator>skoelpin</dc:creator>
      <dc:date>2018-07-24T14:10:28Z</dc:date>
    </item>
    <item>
      <title>Re: Need to print response time of request</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Need-to-print-response-time-of-request/m-p/456509#M41120</link>
      <description>&lt;P&gt;hello there, &lt;/P&gt;

&lt;P&gt;as @skoelpin suggested, a unique identifier will help you to tie the events together.&lt;BR /&gt;
i mimicked an identifier for the following example, after the &lt;CODE&gt;Summary(TransactionId-)&lt;/CODE&gt; in this case &lt;CODE&gt;Summary(TransactionId-123)&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;try the following search anywhere:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults count=1 
| eval data = "24-07-2018 09:41:47:111 [RetrieveInterestRate][INFO ]: |BEM_Gateway_Request_MF Request Processing Summary(TransactionId-123) SCVT Recieved Request at 24-07-2018 09:41:47:108
; 24-07-2018 09:41:47:239 [RetrieveInterestRate][INFO ]: |BEM_Gateway_Response_MF Request Processing Summary(TransactionId-123) SCVT sent response back to consumer at 24-07-2018 09:41:47:236"
| makemv delim=";" data 
| mvexpand data
| rex field=data "SCVT\s+(?&amp;lt;request_or_response&amp;gt;[^\s]+).+at\s+(?&amp;lt;time&amp;gt;\d{2}\-\d{2}\-\d{4}\s+\d{2}\:\d{2}\:\d{2}\:\d{3})"
| rex field=data "TransactionId\-(?&amp;lt;transaction_id&amp;gt;\S+)\)"
| eval time_epoch = strptime(time, "%d-%m-%Y %H:%M:%S:%3N")
| eval recieved_time = if(request_or_response="Recieved",time_epoch,null())
| eval response_time = if(request_or_response="sent",time_epoch,null())
| stats values(recieved_time) as rec_time values(response_time) as res_time by transaction_id
| eval duration_in_seconds = res_time - rec_time
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;hope it helps&lt;/P&gt;</description>
      <pubDate>Tue, 24 Jul 2018 14:30:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Need-to-print-response-time-of-request/m-p/456509#M41120</guid>
      <dc:creator>adonio</dc:creator>
      <dc:date>2018-07-24T14:30:35Z</dc:date>
    </item>
    <item>
      <title>Re: Need to print response time of request</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Need-to-print-response-time-of-request/m-p/456510#M41121</link>
      <description>&lt;P&gt;Thanks &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/190478"&gt;@adonio&lt;/a&gt;  n &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/132691"&gt;@skoelpin&lt;/a&gt;&lt;/P&gt;

&lt;P&gt;I tried the command which is given by adonio   and it works successfully for manual entry(makeresults  value). But whenever I am dealing with actual file it showing empty data. PFB my command,&lt;/P&gt;

&lt;P&gt;bemLog=RetrieveInterestRate | eval Event = "RetrieveInterestRate" | makemv delim=";" Event | mvexpand Event | rex field=Event "SCVT\s+(?[^\s]+).+at\s+(?\d{2}-\d{2}-\d{4}\s+\d{2}:\d{2}:\d{2}:\d{3})" | rex field=Event "TransactionId-(?\S+))"  | eval time_epoch = strptime(time, "%d-%m-%Y %H:%M:%S:%3N") | eval recieved_time = if(request_or_response="Recieved",time_epoch,null()) | eval response_time = if(request_or_response="sent",time_epoch,null())  | stats values(recieved_time) as rec_time values(response_time) as res_time by transaction_id | eval duration_in_seconds = res_time - rec_time&lt;/P&gt;

&lt;P&gt;bemLog=RetrieveInterestRate printing the logs in below format&lt;BR /&gt;
 Time                   Event &lt;BR /&gt;
 7/25/18            25-07-2018 10:47:46:680 [RetrieveInterestRate][INFO ]: |BEM_Gateway_Response_MF Request Processing Summary(Transaction Id-ABC123)&lt;BR /&gt;
10:47:46.680 AM     SCVT sent response back to consumer at 25-07-2018 10:47:46:671&lt;/P&gt;

&lt;P&gt;7/25/18             5-07-2018 10:47:46:540 [RetrieveInterestRate][INFO ]: |BEM_Gateway_Request_MF Request Processing Summary(TransactionId-ABC123)&lt;BR /&gt;
10:47:46.540 AM SCVT Recieved Request at 25-07-2018 10:47:46:537&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 20:38:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Need-to-print-response-time-of-request/m-p/456510#M41121</guid>
      <dc:creator>ajaynaralikar</dc:creator>
      <dc:date>2020-09-29T20:38:37Z</dc:date>
    </item>
    <item>
      <title>Re: Need to print response time of request</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Need-to-print-response-time-of-request/m-p/456511#M41122</link>
      <description>&lt;P&gt;I got issue  and issue with command and it is related to delimiter  and in my logs delimiter is new line.&lt;BR /&gt;
So can you tell me how to set parameter to new line like  command makemv delim=";"&lt;BR /&gt;
Also I searched and get to know that there is know mechanism to set parameter for \n.&lt;/P&gt;</description>
      <pubDate>Wed, 25 Jul 2018 12:12:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Need-to-print-response-time-of-request/m-p/456511#M41122</guid>
      <dc:creator>ajaynaralikar</dc:creator>
      <dc:date>2018-07-25T12:12:50Z</dc:date>
    </item>
    <item>
      <title>Re: Need to print response time of request</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Need-to-print-response-time-of-request/m-p/456512#M41123</link>
      <description>&lt;P&gt;As discussed earlier, you need a unique identifier for the request response pair so you can tie them together and do the math on the timestamp.. @Adonio example is a run-anywhere example which uses &lt;CODE&gt;| makeresults&lt;/CODE&gt; to add that unique identifier. Until you have the unique identifier for each pair, you cannot do it &lt;/P&gt;</description>
      <pubDate>Wed, 25 Jul 2018 13:49:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Need-to-print-response-time-of-request/m-p/456512#M41123</guid>
      <dc:creator>skoelpin</dc:creator>
      <dc:date>2018-07-25T13:49:36Z</dc:date>
    </item>
    <item>
      <title>Re: Need to print response time of request</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Need-to-print-response-time-of-request/m-p/456513#M41124</link>
      <description>&lt;P&gt;the first 5 lines in my command only generating fake data&lt;BR /&gt;
try to replace them with a search that finds events: &lt;CODE&gt;index = &amp;lt;some_index&amp;gt; sourcetype = &amp;lt;some_sourcetype&amp;gt; ...&lt;/CODE&gt;&lt;BR /&gt;
also remove the &lt;CODE&gt;field=data&lt;/CODE&gt; from the &lt;CODE&gt;rex&lt;/CODE&gt; command&lt;BR /&gt;
pay attention to your data, do you  have a unique identifier that will help tie down events together?&lt;BR /&gt;
if not how can you tell which "response" goes with which "received"&lt;/P&gt;</description>
      <pubDate>Wed, 25 Jul 2018 13:57:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Need-to-print-response-time-of-request/m-p/456513#M41124</guid>
      <dc:creator>adonio</dc:creator>
      <dc:date>2018-07-25T13:57:56Z</dc:date>
    </item>
  </channel>
</rss>

