Forum Discussion
LTM iRule to measure duration of server side TCP connection in case of OneConnect profile applied to VS
We are currently migration from ACE to F5 LTM and trying to replicate ACE functionality as much as we can.
One of the ACE features is logging of duration of TCP connection and number of bytes on this connection (when connection closes)
I am trying to replicate it with this iRule:
when SERVER_CONNECTED { set tcp_start_time_server [clock clicks -milliseconds]
when SERVER_CLOSED { HSL::send $lpAll "Closed server-side TCP connection from translated [IP::local_addr]:[TCP::local_port] to pool member [IP::server_addr]:[TCP::server_port] (bytes from server [IP::stats bytes in]/bytes to server [IP::stats bytes out]) (open for: [expr {[clock clicks -milliseconds] - $tcp_start_time_server}] ms)"
And it works fine if no OneConnect profile applied to the VS. However, with OneConnect, when connection re-use on the server side happens, it appears that event when SERVER_CONNECTED doesn't happen all the time, variable tcp_start_time_server doesn't exist and I get TCL error in the log:
TCL error: /Common/time_test - can't read "tcp_start_time_server": no such variable while executing "expr {[clock clicks -milliseconds] - $tcp_start_time_server}"
Is there a way to calculate server-side TCP connection duration when OneConnect is applied to a VS? It is beyond me in terms of my knowledge at the moment.
1 Reply
- VernonWells
Employee
If you are using at least 11.3, you can use a Request Logging Profile to achieve this without an iRule:
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com