Forum Discussion
Syntax to Map Virtual-Server's Character with Data-Group which Contains Pool Name
Hi Kevin,
As suggested by you, We created Data-Groups for Static( Parveez_Static104 ) as well as Dynamic(Parveez_Dynamic104) Contents and modified the Irule as below:
For Virtual-servers mentioned below respectively:
a) apuat.leni2.com-VS-HTTP b) apbuild.leni2.com-VS-HTTP c) apctdev.leni2.com-VS-HTTP
a) Virtual-server: apuat.leni2.com-VS-HTTP
Associated Irule as below:
when CLIENT_ACCEPTED { set default_pool [LB::server pool]
log local0. "Default pool [LB::server pool] set" log local0. "Client IP is [IP::remote_addr]" } when HTTP_REQUEST { switch -glob [HTTP::uri] { "/" { log local0. "redirecting from /" HTTP::redirect "http://apuat.leni2.com/SEUILibrary/controller/e/web/LenovoPortal/en_US/catalog.workflow:test-home"
return pool pool_apuat_leni2.com_http } "/iss_static*" { if { [class match [virtual] equals Parveez_Static104] } { pool [lindex [split [class match -value [virtual] equals Parveez_Static104] ","] 1] } else { log local0. "Static pool entry for [virtual] not created yet" reject } return } default { if { [class match [virtual] equals Parveez_Dynamic104] } { pool [lindex [split [class match -value [virtual] equals Parveez_Dynamic104] ","] 0] } else { log local0. "Dynamic pool entry for [virtual] not created yet" reject } return } } }
b. Virtual-Server : apbuild.leni2.com-VS-HTTP:
Associated Irule as below:
when CLIENT_ACCEPTED { set default_pool [LB::server pool]
log local0. "Default pool [LB::server pool] set" log local0. "Client IP is [IP::remote_addr]" } when HTTP_REQUEST { switch -glob [HTTP::uri] { "/" { log local0. "redirecting from /" HTTP::redirect "http://apbuild.leni2.com/SEUILibrary/controller/e/web/LenovoPortal/en_US/catalog.workflow:test-home"
return pool pool_apbuild_leni2.com_http } "/iss_static*" { if { [class match [virtual] equals Parveez_Static104] } { pool [lindex [split [class match -value [virtual] equals Parveez_Static104] ","] 1] } else { log local0. "Static pool entry for [virtual] not created yet" reject } return } default { if { [class match [virtual] equals Parveez_Dynamic104] } { pool [lindex [split [class match -value [virtual] equals Parveez_Dynamic104] ","] 0] } else { log local0. "Dynamic pool entry for [virtual] not created yet" reject } return } } }
c. apctdev.leni2.com-VS-HTTP:
Associated Irule as below:
when CLIENT_ACCEPTED { set default_pool [LB::server pool]
log local0. "Default pool [LB::server pool] set" log local0. "Client IP is [IP::remote_addr]" } when HTTP_REQUEST { switch -glob [HTTP::uri] { "/" { log local0. "redirecting from /" HTTP::redirect "http://apctdev.leni2.com/SEUILibrary/controller/e/web/LenovoPortal/en_US/catalog.workflow:test-home"
return pool pool_apctdev.leni2.com_http } "/iss_static*" { if { [class match [virtual] equals Parveez_Static104] } { pool [lindex [split [class match -value [virtual] equals Parveez_Static104] ","] 1] } else { log local0. "Static pool entry for [virtual] not created yet" reject } return } default { if { [class match [virtual] equals Parveez_Dynamic104] } { pool [lindex [split [class match -value [virtual] equals Parveez_Dynamic104] ","] 0] } else { log local0. "Dynamic pool entry for [virtual] not created yet" reject } return } } }
Now the requirement is: incase we can put the ist part of the Irule too into a 3rd Data-group so that when switch-glob for "/" will dynamically select the whole URL amd pool automatically as per the naming convention same as we did for Data-Groups for Static and Dynamic contents For example:
a) In Virtual-server : apuat.leni2.com-VS-HTTP which contains:
"/" as HTTP::redirect "http://apctdev.leni2.com/SEUILibrary/controller/e/web/LenovoPortal/en_US/catalog.workflow:test-home and pool pool_apctdev.leni2.com_http.
a) In Virtual-server : aapbuild.leni2.com-VS-HTTP which contains:
"/" as HTTP::redirect "http://apbuild.leni2.com/SEUILibrary/controller/e/web/LenovoPortal/en_US/catalog.workflow:test-home" and pool pool_apbuild_leni2.com_http.
c) In Virtual-server : apctdev.leni2.com-VS-HTTP which contains:
"/" as HTTP::redirect "http://apctdev.leni2.com/SEUILibrary/controller/e/web/LenovoPortal/en_US/catalog.workflow:test-home" and pool pool_apctdev.leni2.com_http
Kindly suggest.
Thanks and Regards Parveez
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