Forum Discussion
Moinul_Rony
Altostratus
May 14, 2014How to destroy and replace a URI query value ?
Hi,
I am trying to figure out how I can replace a URI query value.
For example for this we will select the URL based on the HTTP:host
Incoming URL pattern
https://host/URI?
http...
nitass
Employee
May 18, 2014e.g.
config
[root@ve11a:Active:In Sync] config tmsh list ltm rule qux
ltm rule qux {
when HTTP_REQUEST {
set q [URI::query [HTTP::uri] query]
log local0. "q = $q"
if { $q eq "A" } {
log local0. "origin uri = [HTTP::uri]"
HTTP::uri [string map "query=$q query=B" [HTTP::uri]]
log local0. "new uri = [HTTP::uri]"
}
}
}
/var/log/ltm
[root@ve11a:Active:In Sync] config tail -f /var/log/ltm
May 18 21:32:58 ve11a info tmm[14715]: Rule /Common/qux : q = A
May 18 21:32:58 ve11a info tmm[14715]: Rule /Common/qux : origin uri = /URI?query=A&other=somethingelse
May 18 21:32:58 ve11a info tmm[14715]: Rule /Common/qux : new uri = /URI?query=B&other=somethingelse
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