iRule
Components
iRules Syntax
Variables
set msg "Hello, World!" # Local Variable
set ::myGlobal "Hello, World!" # Global variable, REMEMBER to unset
unset msg
unset msg r vbl
set r [expr rand()]
set vbl in[expr {rand() >= 0.5}]
set reqArray([IP::client_addr]) [getfield [string tolower [HTTP::uri]] "?" 2]
# append data to variable
set var 0
for {set i 1} {$i<=10} {incr i} {
append var "," $i
}
puts $var # Prints 0,1,2,3,4,5,6,7,8,9,10
#Join values
concat " a b {c " d " e} f"
will return "a b {c d e} f" as its result.
# Increase values
Add one to the contents of the variable x:
incr x
Add 42 to the contents of the variable x:
incr x 42Switch command
Some iRule Samples
iRule Event
Reference
Last updated