Forum Discussion
Adding logging to Redirect Irule.
I have an Irule that I wrote to perform redirect when pool becomes unavailable. I am trying to insert some logging because when we are seeing users still accessing old URL when site is unavailable. I have been reading DEV Article about logging but can't seem to make it work. I would like to log client IP and if the redirect is used. Any suggestions would be helpful. Thanks
Here is my Irule when HTTP_REQUEST { if { [HTTP::host] equals "web1.com" }{ if { [active_members web_pool] equals 0 } { HTTP::redirect "http://web2.com" } } }
2 Replies
- Vijay_E
Cirrus
Use "log local0." statement wherever you want to log and whatever element you are trying to log:
when HTTP_REQUEST { if { [HTTP::host] equals "web1.com" } { if { [active_members web_pool] equals 0 } { log local0."Host header - [HTTP::host]" HTTP::redirect "http://web2.com" } } }Refer to this link for more details.
- The_Y
Cirrus
I believe this will help
HTTP_REQUEST { if { [HTTP::host] equals "web1.com" }{ if { [active_members web_pool] equals 0 } { HTTP::redirect "
log local0. "Client IP Address [IP::client_addr] has been redirected" }} }
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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