Forum Discussion
Parveez_70209
Nov 06, 2013Nimbostratus
Irules Data-Group
Hi,
Need your assistance into this topic related to Irule Based on Data-Groups:
Currently we have total 120 Virtual-Servers( 60 HTTP profiles + 60 HTTPS Profiles) created into the Load-Balancer ...
IheartF5_45022
Nov 08, 2013Nacreous
Syntax should be correct - I saved it on my F5 OK, however to create your datagroup before you try to save the iRule - I am assuming you are using v10?
b shell
class dg_parveez_dynamic_pools {
{
"apctdev.leni2.com-VS-HTTP" { "pool_apctdev.leni2.com_http" }
"apbuild.leni2.com-VS-HTTP" { "pool_apbuild.leni2.com_http" }
"apctdev.leni2.com-VS-HTTP" { "pool_apctdev.leni2.com_http" }
}
}
save
Then here is the iRule - you will need to update the line "pool $static_pool" yourself;
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://www.parveez.com"
return
pool pool_parveez.com-http
}
"/iss_static*" {
pool $static_pool
return
}
default {
pool [class match -element [string tolower [virtual]] starts_with dg_parveez_dynamic_pools ]
return
}
}
}
Good luck and have a nice weekend - I am off now!!
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