Forum Discussion
How to use the ":1" in irules with HTTP:QUERY?
- Jun 24, 2019
Hi DavidMas,
the iRule redirects you to a destination setup by a concatenated string. The portions of the string are https:// followed by the value of [getfield [HTTP:host] ":" 1 ] followed by the original [HTTP:uri] the client has currently requested (e.g. "https://www.domain.de/example1").
The nested [getfield [HTTP:host] ":" 1 ] command extracts at first the [HTTP::host] value from the HTTP request (e.g. could be www.domain.com or www.domain.com:80) and then passes the output to the outer [getfield] command, which then splits the value on each single : character and finally outputs just the first element (e.g. www.domain.com:80 will become www.domain.com) back to the concatenated string.
Cheers, Kai
Hi DavidMas,
the iRule redirects you to a destination setup by a concatenated string. The portions of the string are https:// followed by the value of [getfield [HTTP:host] ":" 1 ] followed by the original [HTTP:uri] the client has currently requested (e.g. "https://www.domain.de/example1").
The nested [getfield [HTTP:host] ":" 1 ] command extracts at first the [HTTP::host] value from the HTTP request (e.g. could be www.domain.com or www.domain.com:80) and then passes the output to the outer [getfield] command, which then splits the value on each single : character and finally outputs just the first element (e.g. www.domain.com:80 will become www.domain.com) back to the concatenated string.
Cheers, Kai
- David_MJun 24, 2019Cirrostratus
Alright . .thanks for the detailed answer:
The request I have is this . ..So I see it does not have any " : " char means nothing will be split at all, right?
GET /example1/?id=1 HTTP/1.0 Host: www.example2.com
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