<?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: Finding number of requests and their response time in last 24 hours in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Finding-number-of-requests-and-their-response-time-in-last-24/m-p/80239#M181816</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I am not successful in extracting the url in this case. I am using the following query but I am not getting the expected result. &lt;/P&gt;

&lt;P&gt;sourcetype="mysourcetype" | transaction "&lt;A href="http://na.api.inrix.com/V3/Traffic/Inrix.ashx" target="_blank"&gt;http://na.api.inrix.com/V3/Traffic/Inrix.ashx&lt;/A&gt;" startswith="POST request for : " endswith="Http request complete status 200 OK" maxevents=2 | stats count as Total_Requests avg(duration) as Average_Response_Time&lt;/P&gt;

&lt;P&gt;Any help on this please!!&lt;/P&gt;</description>
    <pubDate>Mon, 28 Sep 2020 09:54:17 GMT</pubDate>
    <dc:creator>anushamkrishna</dc:creator>
    <dc:date>2020-09-28T09:54:17Z</dc:date>
    <item>
      <title>Finding number of requests and their response time in last 24 hours</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Finding-number-of-requests-and-their-response-time-in-last-24/m-p/80237#M181814</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I have two log messages like this:&lt;/P&gt;

&lt;H1&gt;Log 1:&lt;/H1&gt;

&lt;P&gt;2011-09-22 14:35:21,441 [Thread-20] DEBUG NHTTPClient2 - Execute http POST request for : &lt;A href="http://na.api.inrix.com/V3/Traffic/Inrix.ashx"&gt;http://na.api.inrix.com/V3/Traffic/Inrix.ashx&lt;/A&gt;&lt;/P&gt;

&lt;H1&gt;Log 2:&lt;/H1&gt;

&lt;P&gt;2011-09-22 14:35:22,122 [New I/O client worker #1-1] INFO  NHTTPClient2 - Http request complete status 200 OK, Url &lt;A href="http://na.api.inrix.com/V3/Traffic/Inrix.ashx"&gt;http://na.api.inrix.com/V3/Traffic/Inrix.ashx&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Log 1 is the request and log 2 is the response. I want to find out how many requests were being made and their corresponding response time in the last 24 hours and for the last one week.&lt;/P&gt;

&lt;P&gt;How to query this requirement.&lt;/P&gt;

&lt;P&gt;Any help is much appreciated!!&lt;/P&gt;</description>
      <pubDate>Thu, 22 Sep 2011 19:10:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Finding-number-of-requests-and-their-response-time-in-last-24/m-p/80237#M181814</guid>
      <dc:creator>anushamkrishna</dc:creator>
      <dc:date>2011-09-22T19:10:44Z</dc:date>
    </item>
    <item>
      <title>Re: Finding number of requests and their response time in last 24 hours</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Finding-number-of-requests-and-their-response-time-in-last-24/m-p/80238#M181815</link>
      <description>&lt;P&gt;if you extract the url from both lines, you could use the transaction command,&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|transaction url startswith="POST request" endswith="request complete" maxevents=2 | stats count as Total_Requests avg(duration) as Average_Response_Time
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This will show you the total requests and the average duration of each request.  By using the transaction command you get the "duration" field automatically.  Without doing the stats command you'll be able to see the duration of each event and search on duration.  For instance you could do things like:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|transaction url startswith="POST request" endswith="request complete" maxevents=2 | top url by duration |  sort - duration
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This would list the top durations and their corresponding URL's so you can see which pages take the longest to load.&lt;/P&gt;

&lt;P&gt;or &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|stats max(duration) by url
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;to see what was the longest amount of time taken to load any url.&lt;/P&gt;</description>
      <pubDate>Fri, 23 Sep 2011 03:54:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Finding-number-of-requests-and-their-response-time-in-last-24/m-p/80238#M181815</guid>
      <dc:creator>bbingham</dc:creator>
      <dc:date>2011-09-23T03:54:16Z</dc:date>
    </item>
    <item>
      <title>Re: Finding number of requests and their response time in last 24 hours</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Finding-number-of-requests-and-their-response-time-in-last-24/m-p/80239#M181816</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I am not successful in extracting the url in this case. I am using the following query but I am not getting the expected result. &lt;/P&gt;

&lt;P&gt;sourcetype="mysourcetype" | transaction "&lt;A href="http://na.api.inrix.com/V3/Traffic/Inrix.ashx" target="_blank"&gt;http://na.api.inrix.com/V3/Traffic/Inrix.ashx&lt;/A&gt;" startswith="POST request for : " endswith="Http request complete status 200 OK" maxevents=2 | stats count as Total_Requests avg(duration) as Average_Response_Time&lt;/P&gt;

&lt;P&gt;Any help on this please!!&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 09:54:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Finding-number-of-requests-and-their-response-time-in-last-24/m-p/80239#M181816</guid>
      <dc:creator>anushamkrishna</dc:creator>
      <dc:date>2020-09-28T09:54:17Z</dc:date>
    </item>
    <item>
      <title>Re: Finding number of requests and their response time in last 24 hours</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Finding-number-of-requests-and-their-response-time-in-last-24/m-p/80240#M181817</link>
      <description>&lt;P&gt;to extract the text into a field, you either need to use a regex expression in props.conf / transforms.conf or you can use the "rex" command.  In your case,  assuming the url is only printed 1x on each line, use:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|rex field=_raw "(?&amp;lt;url&amp;gt;http://[A-z0-9./]+)"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;then use the transaction command exactly as I have above:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|transaction url startswith="POST request" endswith="request complete" maxevents=2 | top url by duration |  sort - duration
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;As a side note, your endswith will only close a transaction if the response code was a 200, you may want to capture all responses as I have in mine.&lt;/P&gt;</description>
      <pubDate>Fri, 23 Sep 2011 16:06:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Finding-number-of-requests-and-their-response-time-in-last-24/m-p/80240#M181817</guid>
      <dc:creator>bbingham</dc:creator>
      <dc:date>2011-09-23T16:06:51Z</dc:date>
    </item>
    <item>
      <title>Re: Finding number of requests and their response time in last 24 hours</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Finding-number-of-requests-and-their-response-time-in-last-24/m-p/80241#M181818</link>
      <description>&lt;P&gt;and then if you only care about the 200's do a search afterwards | search "status 200 OK"&lt;/P&gt;

&lt;P&gt;so your final search would be:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|rex field=_raw "(?&amp;lt;url&amp;gt;http://[A-z0-9./]+)"
|transaction url startswith="POST request" endswith="request complete" maxevents=2
|stats count as Total_Requests avg(duration) as Average_Response_Time
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 23 Sep 2011 16:07:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Finding-number-of-requests-and-their-response-time-in-last-24/m-p/80241#M181818</guid>
      <dc:creator>bbingham</dc:creator>
      <dc:date>2011-09-23T16:07:34Z</dc:date>
    </item>
    <item>
      <title>Re: Finding number of requests and their response time in last 24 hours</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Finding-number-of-requests-and-their-response-time-in-last-24/m-p/80242#M181819</link>
      <description>&lt;P&gt;Sorry for bothering you again. The query which you have provided me is fetching the results for all the URLs but I need the results only for this URL:&lt;/P&gt;

&lt;P&gt;&lt;A href="http://na.api.inrix.com/V3/Traffic/Inrix.ashx"&gt;http://na.api.inrix.com/V3/Traffic/Inrix.ashx&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;How to get that? Thanks!!&lt;/P&gt;</description>
      <pubDate>Fri, 23 Sep 2011 17:40:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Finding-number-of-requests-and-their-response-time-in-last-24/m-p/80242#M181819</guid>
      <dc:creator>anushamkrishna</dc:creator>
      <dc:date>2011-09-23T17:40:19Z</dc:date>
    </item>
    <item>
      <title>Re: Finding number of requests and their response time in last 24 hours</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Finding-number-of-requests-and-their-response-time-in-last-24/m-p/80243#M181820</link>
      <description>&lt;P&gt;limit the search going into the transaction command, it'll be faster, &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|rex field=_raw "(?&amp;lt;url&amp;gt;http://[A-z0-9./]+)"
|search url="http://na.api.inrix.com/V3/Traffic/Inrix.ashx"
|transaction url startswith="POST request" endswith="request complete" maxevents=2
|stats count as Total_Requests avg(duration) as Average_Response_Time
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 23 Sep 2011 17:43:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Finding-number-of-requests-and-their-response-time-in-last-24/m-p/80243#M181820</guid>
      <dc:creator>bbingham</dc:creator>
      <dc:date>2011-09-23T17:43:12Z</dc:date>
    </item>
  </channel>
</rss>

