Forum Discussion
Syntax for iRule string manipulation
I have an iRule with the following code:
set schema [getfield [HTTP::uri] "&" 2]
set host [getfield [HTTP::uri] "&" 3]
set uri [getfield [HTTP::uri] "&" 4]
which works in the vast majority of cases. However, in cases where the URI itself contains an ampersand character, the string is truncated.
Is there an alternative I could replace the 3rd line with which would return everything after the 3rd ampersand character in a string? I could do it quite easily on other languages, but can't quite get my head around the syntax for TCL!
Many thanks
- Stanislas_Piro2
Cumulonimbus
HTTP query ordered parameters is not the best solution...
I guess the uri format is :
/page.php?var1=value1&schema=value2&host=value3&uri=value4
you can use following command to get query string parameters
set schema [URI::query [HTTP::uri] schema] set host [URI::query [HTTP::uri] host] set uri [URI::query [HTTP::uri] 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