Aurel
Dec 02, 2013Cirrus
Irule syntax issue : missing a script
Hi, I'm having the error message on line 18 "missing a script". What i'm trying to do with this iRule is to append one or two "0" when the $fract value contains only two or one digit, whereas most of the time is has 3 digits.
Any help so much welcome.
when HTTP_REQUEST {
set secs [clock seconds]
set msec [clock clicks -milliseconds]
set base [expr { $secs * 1000 } ]
set fract [expr { $msec - $base }]
log local0. "step_1 $fract"
if {$fract >= 1000 } { set diff [expr { $fract / 1000 }] incr secs $diff incr fract [expr { -1000 * $diff }]}
log local0. "step_2 $fract"
if {[$fract matches_regex "\d\d"]} append fract 0 elseif {$fract matches_regex {/\d}} append fract 00
log local0. "Timestamp with milliseconds is $secs.$fract" }