<?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: F5 Networks iRule req_elapsed_time=0 in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/F5-Networks-iRule-req-elapsed-time-0/m-p/44947#M179250</link>
    <description>&lt;P&gt;we're running 10.2.1 right now&lt;/P&gt;

&lt;P&gt;I have forwarded the link to the group that has access to see if they can get a response through that.&lt;/P&gt;

&lt;P&gt;If there are any other hints for the irule code that would be appreciated.&lt;/P&gt;

&lt;P&gt;thanks for the response&lt;/P&gt;</description>
    <pubDate>Tue, 08 May 2012 13:49:25 GMT</pubDate>
    <dc:creator>EricPartington</dc:creator>
    <dc:date>2012-05-08T13:49:25Z</dc:date>
    <item>
      <title>F5 Networks iRule req_elapsed_time=0</title>
      <link>https://community.splunk.com/t5/Splunk-Search/F5-Networks-iRule-req-elapsed-time-0/m-p/44945#M179248</link>
      <description>&lt;P&gt;trying to implement the irule supplied by F5, we can get the irule to log to splunk.  &lt;/P&gt;

&lt;P&gt;We are having and issue with the req_elapsed_time field as it is always returning 0&lt;/P&gt;

&lt;P&gt;Anyone else using that value and getting something other than 0 for a value?&lt;/P&gt;

&lt;P&gt;We are trying to use the iRule to determine the response time for surfing via a particular pool and this value appears to be the one we need.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 11:46:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/F5-Networks-iRule-req-elapsed-time-0/m-p/44945#M179248</guid>
      <dc:creator>EricPartington</dc:creator>
      <dc:date>2020-09-28T11:46:43Z</dc:date>
    </item>
    <item>
      <title>Re: F5 Networks iRule req_elapsed_time=0</title>
      <link>https://community.splunk.com/t5/Splunk-Search/F5-Networks-iRule-req-elapsed-time-0/m-p/44946#M179249</link>
      <description>&lt;P&gt;which version of F5 Big-ip you use ? &lt;/P&gt;

&lt;P&gt;Because in 11.x the Request logging parameters to get those values is &lt;CODE&gt;RESPONSE_MSECS&lt;/CODE&gt; (The elapsed time in milliseconds (ms) between receiving the request and sending the response. )&lt;/P&gt;

&lt;P&gt;&lt;A href="https://support.f5.com/kb/en-us/products/big-ip_ltm/manuals/product/tmos-implementations-11-1-0/22.html?sr=21145698"&gt;Request Logging Profile&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 08 May 2012 08:38:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/F5-Networks-iRule-req-elapsed-time-0/m-p/44946#M179249</guid>
      <dc:creator>MarioM</dc:creator>
      <dc:date>2012-05-08T08:38:45Z</dc:date>
    </item>
    <item>
      <title>Re: F5 Networks iRule req_elapsed_time=0</title>
      <link>https://community.splunk.com/t5/Splunk-Search/F5-Networks-iRule-req-elapsed-time-0/m-p/44947#M179250</link>
      <description>&lt;P&gt;we're running 10.2.1 right now&lt;/P&gt;

&lt;P&gt;I have forwarded the link to the group that has access to see if they can get a response through that.&lt;/P&gt;

&lt;P&gt;If there are any other hints for the irule code that would be appreciated.&lt;/P&gt;

&lt;P&gt;thanks for the response&lt;/P&gt;</description>
      <pubDate>Tue, 08 May 2012 13:49:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/F5-Networks-iRule-req-elapsed-time-0/m-p/44947#M179250</guid>
      <dc:creator>EricPartington</dc:creator>
      <dc:date>2012-05-08T13:49:25Z</dc:date>
    </item>
    <item>
      <title>Re: F5 Networks iRule req_elapsed_time=0</title>
      <link>https://community.splunk.com/t5/Splunk-Search/F5-Networks-iRule-req-elapsed-time-0/m-p/44948#M179251</link>
      <description>&lt;P&gt;There is good article on devcentral:&lt;BR /&gt;
&lt;A href="https://devcentral.f5.com/Tutorials/TechTips/tabid/63/articleType/ArticleView/articleId/1084350/BIG-IP-Logging-and-Reporting-Toolkit-ndash-part-three.aspx"&gt;https://devcentral.f5.com/Tutorials/TechTips/tabid/63/articleType/ArticleView/articleId/1084350/BIG-IP-Logging-and-Reporting-Toolkit-ndash-part-three.aspx&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 08 May 2012 15:12:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/F5-Networks-iRule-req-elapsed-time-0/m-p/44948#M179251</guid>
      <dc:creator>MarioM</dc:creator>
      <dc:date>2012-05-08T15:12:11Z</dc:date>
    </item>
    <item>
      <title>Re: F5 Networks iRule req_elapsed_time=0</title>
      <link>https://community.splunk.com/t5/Splunk-Search/F5-Networks-iRule-req-elapsed-time-0/m-p/44949#M179252</link>
      <description>&lt;P&gt;I have looked into the iRule code a bit further. I reproduced this issue in my lab environment.&lt;/P&gt;

&lt;P&gt;I made some immediate changes to the supplied iRule to correct this.&lt;BR /&gt;
I will continue to evaluate this and provide fixes to Splunk for posting in the near future.&lt;/P&gt;

&lt;P&gt;In the mean time here is the latest iRule. For now i copied the calculation for the req_elapsed_time to be within the context of HTTP_RESPONSE&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;when CLIENT_ACCEPTED {
    set client [IP::client_addr]
}

when HTTP_REQUEST {
    set vhost [HTTP::host]:[TCP::local_port]
    set url [HTTP::uri]
    set method [HTTP::method]
    set http_version [HTTP::version]
    set user_agent [HTTP::header "User-Agent"]
    set tcp_start_time [clock clicks -milliseconds]
    set req_start_time [clock format [clock seconds] -format "%Y/%m/%d %H:%M:%S"]
    set req_elapsed_time 0
    set virtual_server [LB::server]

    if { [HTTP::header Content-Length] &amp;gt; 0 } then {
        set req_length [HTTP::header "Content-Length"]
        if {$req_length &amp;gt; 4000000} then {
            set $req_length 4000000
        }
        HTTP::collect $req_length
    } else {
        set req_length 0
    }

    if { [HTTP::header "Referer"] ne "" } then {
        set referer [HTTP::header "Referer"]
    } else {
        set referer -
    }
}

when HTTP_REQUEST_DATA {
    set req_elapsed_time [expr {[clock clicks -milliseconds] - $tcp_start_time}]
    HTTP::release
}

when HTTP_RESPONSE {
    set hsl [HSL::open -proto TCP -pool splunk-2]
    set resp_start_time [clock format [clock seconds] -format "%Y/%m/%d %H:%M:%S"]
    set node [IP::server_addr]:[TCP::server_port]
    set status [HTTP::status]
    set req_elapsed_time [expr {[clock clicks -milliseconds] - $tcp_start_time}]

    if { [HTTP::header Content-Length] &amp;gt; 0 } then {
        set response_length [HTTP::header "Content-Length"]
    } else {
        set response_length 0
    }

    HSL::send $hsl "&amp;lt;190&amp;gt;|$vhost|device_product=Splunk Web Access iRule|$client|$method|\"$url\"|HTTP/$http_version|$user_agent|\"$referer\"|$req_start_time|$req_length|$req_elapsed_time|$node|$status|$resp_start_time|$response_length|$virtual_server\r\n"
}
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 28 Sep 2020 14:25:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/F5-Networks-iRule-req-elapsed-time-0/m-p/44949#M179252</guid>
      <dc:creator>rblair978</dc:creator>
      <dc:date>2020-09-28T14:25:33Z</dc:date>
    </item>
  </channel>
</rss>

