Forum Discussion
Habib_Ulla_Khan
Nimbostratus
Sep 27, 2017Logs triggering due to irule
Hi All, I am getting continues logs for as mentioned below. The irule for which i am getting alerts is below. Looking for more information from experts in devcentral TCL error: /Common/True-C...
Lee_Sutcliffe
Nacreous
Sep 27, 2017You're missing a closing brace "}" I've added it to the last line: I've also moved the 'else' in the first 'if' to be between the close and open braces as TCL sometimes complains about it
when HTTP_REQUEST {
if {[HTTP::header exists True-Client-IP]}{
if {[HTTP::header exists X-Forwarded-For]}{
HTTP::header remove X-Forwarded-For
HTTP::header insert X-Forwarded-For [HTTP::header True-Client-IP]
} else {
HTTP::header insert X-Forwarded-For [HTTP::header True-Client-IP]
}
} else {
if {[HTTP::header exists X-Forwarded-For]}{
HTTP::header remove X-Forwarded-For
HTTP::header insert X-Forwarded-For [IP::client_addr]
} else {
HTTP::header insert X-Forwarded-For [IP::client_addr]
}
}
}
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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
