Forum Discussion
Perween_Zaman_7
Nimbostratus
Nov 06, 2005Question on getfield
Hi
If my URL is http://myDomain.com/myImage.img
what will be the value of the variable second_field in this iRule?
set second_field [getfield [HTTP::uri] "/" 2]
...
Nov 07, 2005
The value will be myImage.img. Here's the reason why. getfield works like this:
{field1}{sep}{field2}{sep}{field3}{sep}...
For your URI of
/myImage.img
If you use a slash ("/") as a separator, then the first token will be before the separator and the second will be after. So the field number "1" would be what's before the slash (an empty string) and the field number "2" would be after the first slash (myImage.img).
-Joe
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