Forum Discussion

mikegray_198028's avatar
Apr 29, 2017

Replace Query parameter value

Hello Team,

Is there any way to rewrite the query string while passing request to pool member.

example request to the vip

https://vip/app/launch?cmd=showIncidents&devicename=router1

request to pool

http://poolmemeber/app/launch?cmd=showIncidents&nodename=router1&newWindow=true&j_username=myuser&j_password=mypassword

Any chance on this

1 Reply

  • You can use HTTP::query command to get or set the query string. You have to extract and rebuild it yourself then feed it to that command. In your case you want to remove devicename and add other items. Here is some example code to get you started...

     

    when HTTP_REQUEST {
        set newquery "cmd=[URI::query [HTTP::uri] cmd]&"
        switch [URI::query [HTTP::uri] devicname] {
            router1 { append newquery "nodename=router1&newWindow=true&j_username=myuser&j_password=mypassword" }
        }
        HTTP::query $newquery
    }