Forum Discussion
Stanley_87566
Nimbostratus
Apr 29, 2009Log millisecond by irule
I'm using irule to log down all load balance traffic via BIGIP. However I cannot record the millisecond for a very high traffic application. Is anybody know how record millisecond by irule on BIPIP? ...
Stanley_87566
Nimbostratus
Jan 07, 2010Thx Aaron, I can log milisecond now. Here's for your reference!
http://devcentral.f5.com/Default.aspx?tabid=53&forumid=5&postid=17943&view=topic
when LB_FAILED {
set info "client { [IP::client_addr]:[TCP::client_port] -> [clientside {IP::local_addr}]:[clientside {TCP::local_port}] }"
set secs [clock seconds]
set msec [clock clicks -milliseconds]
set base [expr { $secs * 1000 } ]
set fract [expr { $msec - $base }]
if { $fract >= 1000 } {
set diff [expr { $fract / 1000 }]
incr secs $diff
incr fract [expr { -1000 * $diff }]
}
append info " Clock" {[clock format [clock seconds] -format "%d/%m/%Y:%H:%M:%S.$fract %z"]}
log local0. "$info - - \[[clock format [clock seconds] -format "%d/%m/%Y:%H:%M:%S.$fract %z"]\]"
}
when SERVER_CONNECTED {
set info "client { [IP::client_addr]:[TCP::client_port] -> [clientside {IP::local_addr}]:[clientside {TCP::local_port}] }"
set secs [clock seconds]
set msec [clock clicks -milliseconds]
set base [expr { $secs * 1000 } ]
set fract [expr { $msec - $base }]
if { $fract >= 1000 } {
set diff [expr { $fract / 1000 }]
incr secs $diff
incr fract [expr { -1000 * $diff }]
}
append info " server { [IP::local_addr]:[TCP::local_port] -> [IP::server_addr]:[TCP::server_port] }"
append info " ethernet { [string range [LINK::lasthop] 0 16] -> [string range [LINK::nexthop] 0 16] tag [LINK::vlan_id] qos [LINK::qos] }"
log local0. "$info - - \[[clock format [clock seconds] -format "%d/%m/%Y:%H:%M:%S.$fract %z"]\]"
}
Aurel
Cirrus
Dec 02, 2013Hi, this trick did offers milliseconds accuracy, but in my case also brings some issues. Sometimes the value is not 3 digits long but can be 2 or only 1. Maybe someone noticed the behaviour as well ?
I understand that this may not be a problem for some cases, but it is for me of course.
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