Correct, ltm is not a procedure. You are receiving the error because you are attempting to paste what I provided into the F5 web interface as an iRule. It is not an iRule.
This is configuration for a profile:
ltm profile statistics DELAY_STAT {
field1 total
field2 webtest_total
field3 webtest_slow
field4 webtest_fast
}
What I provided is not iRule code, it's a snippet of configuration in tmsh format which includes both a statistics profile and an iRule.
What you are attempting to paste into the F5 is not an iRule, it is a snippet of configuration.
Here is the iRule configuration, not the iRule code:
ltm rule LOG-Delay {
when RULE_INIT {
what is a slow response in milliseconds
set static::slow_response 2000
}
when HTTP_REQUEST_SEND {
STATS::incr DELAY_STAT total
clientside {
if {[string tolower [HTTP::host]] contains "onpoint342labupgrade2013"} {
STATS::incr DELAY_STAT webtest_total
set URL [string tolower [HTTP::host]][HTTP::uri]
set SENT [clock clicks -milliseconds]
}
}
}
when HTTP_RESPONE {
exit event if variable is not set
if {![info exists SENT]} { return }
set TIME [expr {[clock clicks -milliseconds] - $SENT}]
if {$TIME >= $static::slow_response} {
STATS::incr DELAY_STAT webtest_slow
log local0. "[HTTP::status]: Client [IP::client_addr]; \
Server [IP::server_addr]:[TCP::server_port]; URL ${URL}; Time ${TIME}ms"
} else {
STATS::incr DELAY_STAT webtest_fast
}
unset SENT URL TIME
}
}
If you want to use exactly what I provided, you would need to log into the CLI and run the command load sys config merge from-terminal. If you are not familiar with this process and its implications, I strongly recommend taking the time to understand how it works.
If you want to just paste in the iRule and do not care about the stats, here is just the iRule code without the STATS::incr command.
when RULE_INIT {
what is a slow response in milliseconds
set static::slow_response 2000
}
when HTTP_REQUEST_SEND {
clientside {
if {[string tolower [HTTP::host]] contains "onpoint342labupgrade2013"} {
set URL [string tolower [HTTP::host]][HTTP::uri]
set SENT [clock clicks -milliseconds]
}
}
}
when HTTP_RESPONE {
exit event if variable is not set
if {![info exists SENT]} { return }
set TIME [expr {[clock clicks -milliseconds] - $SENT}]
if {$TIME >= $static::slow_response} {
log local0. "[HTTP::status]: Client [IP::client_addr]; \
Server [IP::server_addr]:[TCP::server_port]; URL ${URL}; Time ${TIME}ms"
}
unset SENT URL TIME
}
Is that what you are looking for?