Forum Discussion
Tracy_Butler_90
Nimbostratus
Jul 06, 2006writing an irule to log all traffic
Need assistance with writing an irule to log all traffic flow. Support suggested that this should be done versus making changes to the syslog-ng file. I've tried making changes to syslog-ng file wit...
hoolio
Cirrostratus
Oct 18, 2006Here is an example of how you can use clock to get deltas between different points in the rule execution:
when CLIENT_ACCEPTED {
set tcp_start_time [clock clicks -milliseconds]
}
when HTTP_REQUEST {
set http_request_time [clock clicks -milliseconds]
}
when HTTP_RESPONSE {
set http_response_time [ clock clicks -milliseconds ]
}
when CLIENT_CLOSED {
set tcp_end_time [ clock clicks -milliseconds ]
log local0. "HTTP request/response difference: $http_response_time - $http_request_time = [expr $http_response_time - $http_request_time]"
log local0. "Total connection time: $tcp_end_time - $tcp_start_time = [expr ($tcp_end_time - $tcp_start_time)]"
}Apparently, there was an issue with high CPU usage when using the clock command in versions prior to 9.2. I did some searching but couldn't find any relevant CR's. I would upgrade to 9.2.3+ to use the clock function and would make sure to test this rule during a maintenance window if you're applying it to every connection through the BIG-IP.
Aaron
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