Forum Discussion
Understanding IRules and Syntax
when LTM receive a HTTP Request, do the following code
when HTTP_REQUEST {
execute the command HTTP::header exists "x-forwarded-for"
Inserting this command between brackets allow to retreive the result of the command.
the command [HTTP::header exists "x-forwarded-for"] will return 0 if doesn't exist (for false), 1 if exist (for true)
Then [string tolower [HTTP::header exists "x-forwarded-for"]] convert the result of command to lowercase... doesn't make sense because lowercase of a number stay the same...
and finally, if the result is a number different than 0, execute the code between curly brackets
if { [string tolower [HTTP::header exists "x-forwarded-for"]] } {
log in /var/log/ltm the line XFF_HEADER=W.X.Y.Z where W.X.Y.Z is the value of HTTP header X-Forwarded-For
log local0. "XFF_HEADER=[HTTP::header values "X-Forwarded-For"] " } }
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