Forum Discussion
Vince_Beltz_959
Sep 21, 2011Nimbostratus
String Map Fail?
Argh. Can't seem to edit out all that MS crap up there, because I copied this in from an email.
I'm trying to build a function allowing search-and-replace of substrings within a URI. ...
hooleylist
Sep 21, 2011Cirrostratus
This should work fine:
HTTP::uri [string map [list $urisearch $urireplace] $httpuri]
If you want to verify the rewrite is done successfully even thought the value for [HTTP::uri] won't show it, you can log the value in a later priority HTTP_REQUEST event. Just add this code to the end of your existing iRule:
when HTTP_REQUEST priority 501 {
log local0. "[IP::client_addr]:[TCP::client_port]: 501: Updated \[HTTP::uri\]: [HTTP::uri]"
}
Aaron
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