Forum Discussion
Aditya_Mehra
Cirrus
Dec 04, 2018iRule to Remove a part of uri and forward to a pool
Hi,
i am working on an iRule to Remove a part of uri and forward to a pool.
Eg:
xxx/yyy/abc/def
should go to a pool 1 as
i want to remove xxx/yyy
Will the below work? ...
Lee_Sutcliffe
Nacreous
Dec 04, 2018Hi Aditya,
You were almost there, you don't need to set
HTTP::uri and the final } to close the HTTP_REQUEST event was missing. I've also remove some necessary parenthesis and the was no advantage in setting $newUri other than perhaps readability.
when HTTP_REQUEST {
set var1 "xxx/yyy"
if {[HTTP::uri] contains $var1} {
HTTP::uri [string map -nocase [list $var1 ""] [HTTP::uri]]
pool Pool_1
}
}
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
