Forum Discussion
uni
Altocumulus
Sep 13, 2007Preventing interpreting variable as TCL
I have an iRule which is parsing the each field in a URI query. I am getting an occasional problem with a TCL error if $parameter starts with "-", as the interpreter assumes it is an option to the ...
hoolio
Cirrostratus
Sep 13, 2007Can you add logging and reply with the TCL error? It seemed to work as expected in a simple test with a parameter and value that start with a hypher (or two hyphens):
when RULE_INIT {
set param_value "-par1=-val1"
log local0. "\$param_value: $param_value"
log local0. "\[split $param_value =\]: [split $param_value =]"
log local0. "\[lindex \[split $param_value =\] 0\]: [lindex [split $param_value =] 0]"
}Output:
Rule : $param_value: -par1=-val1
Rule : [split -par1=-val1 =]: -par1 -val1
Rule : [lindex [split -par1=-val1 =] 0]: -par1
Aaron
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
