Forum Discussion
iRule Help - Capture URI, Modify, and Redirect
You're probably on the right track with the scan command. TCL scan takes three primary arguments: the string to evaluate, format specifier, and the arbitrary variables to "dump" scanned string values.
So for example, let's take your second URI:
set tmp1 "/A/B/find-a-thing1/thing1detail/actualthing1/garbage"
To scan out each of the URI components into separate variables, it might look something like this:
scan $tmp1 {/%[^/]/%[^/]/%[^/]/%[^/]/%[^/]/%[^/]} a b c d e f
The "%[^/]" specifier says to take all of the characters that are not a forward slash "/" and assign those to one of the variables at the end. With 6 URI components, this dumps each into a separate variable (a-f).
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