Forum Discussion
ArlindT
May 12, 2023Altocumulus
F5 Policy using replace with TCL
Hi, i'm trying to to the following job: when someone try to browse to ictservice.it/some_text/etc i want the policy to add the string ICTDesktop int the path -> ictservice.it/ICTDesktop/some_te...
- May 22, 2023
solved as tcl[HTTP::uri "/ICTDesktop[HTTP::uri]"]
ps: also tcl[HTTP::path "/ICTDesktop[HTTP::path]"] works
Paulius
MVP
ArlindT This might do what you want, this is also assuming I understood the situation.
when HTTP_REQUEST priority 500 {
if {[HTTP::host] == "ictservice.it"} {
if {[[string tolower [HTTP::uri]] == "/some_text/etc"} {
HTTP::uri [string map {"/some_text/etc" "/ICTDesktop/some_text/etc"}[HTTP::uri]]
pool POOL_your_pool
}
}
}
ArlindT
May 13, 2023Altocumulus
thanks for the support,
the challenging thing is this: some_text/etc is a random part, i don't know it before.
I want something like this:
tcl:[string map {random_uri "/ICTdesktop"+random_uri} [HTTP::uri]]
so it adds /ICTdesktop before the random_uri with a tcl implementation.
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