Forum Discussion
Daniel_Cheng_18
Nimbostratus
Apr 12, 2007Can't convert iRule by OTCU
We found the following iRule can't convert When we upgrade our BIGIP from v4.x to v9.x by OTCU.
if (http_uri matches_regex "/opscommon") {
log "*** client_addr: " + client_addr + ...
hoolio
Cirrostratus
Apr 12, 2007Sorry about dropping that. You're trimming off the /opscommon/ from the requested URI using substring. To do that in 9.x you could replace /opscommon with /opsfop/ using 'string map', or use substr.
Here's an example, using string map:
if { [HTTP::uri] starts_with "/opscommon/"}{
log local0. "client: [IP::client_addr], original URI: [HTTP::uri], redirect URI: [string map {/opscommon/ /opsfop/} [HTTP::uri]]"
HTTP::redirect "http://[HTTP::host][string map {/opscommon/ /opsfop/} [HTTP::uri]]"
}
else {
pool OPS-PM
}[edited to fix misplaced }]
Aaron
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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
