Forum Discussion
Jon_46219
Nimbostratus
May 06, 2010Cath error and print virtual server
I have an Irule where I execute: "HTTP::header insert X-Forwarded-For..." and sometimes I get an error.
I have this irule applied in serveral virtual servers so I don't know in which one is happening the problem.
It's possible to print the virtual server's name when error happens?
Thanks.
- Michael_Yates
Nimbostratus
This would be the closest I can think of without writing a custom iRule for each Virtual Server.when HTTP_REQUEST { HTTP::header insert X-Forwarder-For [IP::client_addr] log local0. "X-Forwarded for: [HTTP::host]" }
when HTTP_REQUEST { HTTP::header insert X-Forwarder-For [IP::client_addr] log local0. "X-Forwarded for: My Virutal Server Name" }
- hoolio
Cirrostratus
I agree with Michael that inserting the XFF header using a custom HTTP profile is simpler, more efficient and won't be susceptible to this issue. If you did want to get more information from the iRule, you could log the virtual server name before attempting the header insert. This way you're sure to get the debug logging before the runtime TCL error occurs. Also, you can use the virtual command to log the virtual server name:when HTTP_REQUEST { log local0. "[IP::client_addr]:[TCP::client_port]: Inserting X-Forwarded-For for [virtual name]" HTTP::header insert X-Forwarder-For [IP::client_addr] }
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