Forum Discussion
Peter_Reilly
Nimbostratus
Feb 08, 2005how to log dropped sessions
I would like to be able to use an iRule to log whenever a tcp session is dropped due to it reaching the tcp timeout value specified in a profile. Is there a mechanism to do this within iRules?
unRuleY_95363
Feb 11, 2005Historic F5 Account
Also, I should point out that this method needs a little more work to make it absolutely complete. Basically, a large GET (or PUT) could potentially be confused with a timeout since the prev_age is only updated when the HTTP REQUEST or RESPONSE headers are parsed.
So, to do this correctly, we really need to trigger off all data going through the connection and to do that, we need to use the CLIENT_DATA and SERVER_DATA events.
when CLIENT_ACCEPTED {
set prev_age 0
TCP::collect
set url ""
}
when CLIENT_DATA {
set prev_age [IP::stats age]
TCP::release
TCP::collect
}
when HTTP_REQUEST {
set url [HTTP::host][HTTP::uri]
}
when SERVER_CONNECTED {
TCP::collect
}
when SERVER_DATA {
set prev_age [IP::stats age]
TCP::release
TCP::collect
}
when CLIENT_CLOSED {
if { [expr [IP::stats age] - $prev_age] > [IP::idle_timeout] } {
log "Client: [IP::remote_addr]:[TCP::remote_port] - $url - timed out"
}
}
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* 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
Discover DevCentral Connects