Forum Discussion
Randy_Johnson_1
Nimbostratus
Jan 05, 2010Time stamp format -
Hello, group-
I'd like to insert a HTTP HEADER value that reflects the current time in GMT for a specific set of connections.
I'm comfortabloe in inserting the header, but am having difficulty in getting my timestamp.
I've used iRules like this:
when HTTP_REQUEST {
set http_request_time [clock clicks -milliseconds]
}
when HTTP_RESPONSE {
set http_response_time [ clock clicks -milliseconds ]
log 10.x.y.z local1.info "$request_log_line,\
[expr $http_response_time - $http_request_time]"
}
To log the elapsed time a connection took to a remote syslog, but I'm needing a little help in formatting my timestamp to GMT.
Anyone ?
Thanks !!!
- The_Bhattman
Nimbostratus
Hi Randy, - hoolio
Cirrostratus
You might also want to wrap the operands in the expr command in curly braces for better performance. See the expr man page's 'performance considerations' section for details:log 10.x.y.z local1.info "$request_log_line,\ [expr {[clock clicks -milliseconds] - $http_request_time}]"
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