Forum Discussion
irule scan help in 12.x
I have a requirement to split the uri into two variables. First part of uri should be in one variable and all remaining uri should be in second variable.
If the uri is https://abc.com/abc/def/ghi?123 then
var1 should be abc var2 should be /def/ghi?123
I tried the below scan command but getting error
when HTTP_REQUEST { set reqPath [HTTP::uri] scan $reqPath {/%[^/]%s} service url HTTP::uri "$url" }
TCL error: dev1-rule - can't read "url": no such variable while executing "HTTP::uri "$url""
F5 Version : BIG-IP 12.1.2 Build 0.0.249 Final
- Stanislas_Piro2
Cumulonimbus
Hi
You must evaluate if the scan command matches the whole filter.
when HTTP_REQUEST { set reqPath [HTTP::uri] if { [scan $reqPath {/%[^/]%s} service url] == 2} { HTTP::uri "$url" } { something wrong in URL. No second slash discovered HTTP::uri "/" } }
Recent Discussions
Related Content
* 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