Forum Discussion
nitass_89166
May 02, 2015Noctilucent
shouldn't HTTP::uri be after foreach loop?
by the way, have you tried it on bigip? it seems okay here.
configuration
[root@ve11c:Active:In Sync] config tmsh list ltm rule qux
ltm rule qux {
when HTTP_REQUEST {
log local0. "---"
log local0. "before: [HTTP::uri]"
if {[HTTP::query] contains "Context_"} {
set newq ""
foreach param [split [HTTP::query] "&"] {
if { !($param starts_with "Context_") } {
if { $newq eq "" } {
append newq "?$param"
} else {
append newq "&$param"
}
}
}
if {$newq ne ""} {
HTTP::uri "[HTTP::path]$newq"
} else {
HTTP::uri [HTTP::path]
}
}
}
when HTTP_REQUEST priority 1000 {
log local0. "after: [HTTP::uri]"
}
}
/var/log/ltm
[root@ve11c:Active:In Sync] config tail -f /var/log/ltm
May 2 22:15:28 ve11c info tmm[5649]: Rule /Common/qux : ---
May 2 22:15:28 ve11c info tmm[5649]: Rule /Common/qux : before: /test
May 2 22:15:28 ve11c info tmm[5649]: Rule /Common/qux : after: /test
May 2 22:15:33 ve11c info tmm1[5649]: Rule /Common/qux : ---
May 2 22:15:33 ve11c info tmm1[5649]: Rule /Common/qux : before: /test?param1=value1
May 2 22:15:33 ve11c info tmm1[5649]: Rule /Common/qux : after: /test?param1=value1
May 2 22:15:40 ve11c info tmm[5649]: Rule /Common/qux : ---
May 2 22:15:40 ve11c info tmm[5649]: Rule /Common/qux : before: /test?param1=value1&Context_1=123
May 2 22:15:40 ve11c info tmm[5649]: Rule /Common/qux : after: /test?param1=value1
May 2 22:15:45 ve11c info tmm1[5649]: Rule /Common/qux : ---
May 2 22:15:45 ve11c info tmm1[5649]: Rule /Common/qux : before: /test?Context_1=123¶m1=value1
May 2 22:15:45 ve11c info tmm1[5649]: Rule /Common/qux : after: /test?param1=value1
May 2 22:15:50 ve11c info tmm[5649]: Rule /Common/qux : ---
May 2 22:15:50 ve11c info tmm[5649]: Rule /Common/qux : before: /test?Context_1=123¶m1=value1&Context_2=456¶m2=value2
May 2 22:15:50 ve11c info tmm[5649]: Rule /Common/qux : after: /test?param1=value1¶m2=value2
- Rory_Hewitt_F5_May 02, 2015CirrusHey @nitass, thanks for checking that. I suspect it could be just a Tclkit problem then...