Forum Discussion
Irule redirection based on URL
I modify the irule to get some logs. Now, the Irule looks like that: when CLIENT_ACCEPTED { set client [IP::client_addr] log local0. "Client: $client has established a connection"
} when HTTP_REQUEST { log local0. "Request HTTP is [HTTP::host]" set client_info [IP::client_addr]:[TCP::client_port] set url [HTTP::request] log local0. "Client Source IP: $client_info is requesting URL: $url " switch -exact -- [string tolower [HTTP::host]] { "test1.fr" { pool test1 } "test2.fr" { pool test2 } "test3.fr" { pool test3 } "test4.fr" { pool test4 } } }
when SERVER_CONNECTED { set pool_name [LB::server pool] log local0. "Client Source IP: [IP::client_addr]:[TCP::client_port] <--> POOL : $pool_name <--> ACTUALNODE <--> [IP::server_addr]:[TCP::server_port]" }
It still not working, and on the log, i didn't see the URL requested: Apr 11 16:26:12 BIG-IP-LTM info tmm1[10587]: Rule /Common/Irule_TEST : Client: X.X.X.X has established a connection Apr 11 16:26:12 BIG-IP-LTM info tmm1[10587]: Rule /Common/Irule_TEST : Client: X.X.X.X has established a connection Apr 11 16:26:12 BIG-IP-LTM info tmm1[10587]: Rule /Common/Irule_TEST : Client Source IP: X.X.X.X:31506 is requesting URL: Apr 11 16:26:12 BIG-IP-LTM info tmm1[10587]: Rule /Common/Irule_TEST : Client: X.X.X.X has established a connection Apr 11 16:26:12 BIG-IP-LTM info tmm1[10587]: Rule /Common/Irule_TEST : Client Source IP: X.X.X.X:28300 is requesting URL:
For sure, something is missing on my configuration. On the Virtual server, you just have to add the irule, no POOL ?
regards
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