Forum Discussion

rmelissari_1209's avatar
rmelissari_1209
Icon for Nimbostratus rankNimbostratus
Jul 09, 2013

HTTP::query rewrite

I am trying to rewrite the query of the uri string once it hits the F5, but before it is passed to the server. Everything I have read so far says that the following should work. Could anyone look at it and see if I am doing something wrong? I am using an irule that someone else wrote on the development site to send a person to a specific node on the backend with a variable of ?member=1, and need to strip this from the uri before it is sent to the server. The log shows that the HTTP::query string is not changing, but I have read that it is possible the event is being cached and not properly logging the change. All the logs that I have looked at say it isn't changing though. I am currently using 11.2.1 if that helps. Thanks for any help you can provide.

 

 

when HTTP_REQUEST:

 

...

 

if {$query_member_num ne ""}{

 

set member_num $query_member_num

 

HTTP::query [string map -nocase {"$member_param" ""} [HTTP::query]]

 

if {$member_debug}{log local0. "[IP::client_addr]:[TCP::client_port]:[HTTP::uri] Using member number from URI: \$member_num: $member_num"}

 

}

 

 

 

1 Reply

  • The curly braces in the string map command prevent the variable from being interpreted. Can you try this instead?

     

     

    HTTP::query [string map -nocase [list "$member_param" ""] [HTTP::query]]

     

     

    Aaron