Forum Discussion
Joe_Pena_46781
Nimbostratus
Jan 21, 2009Need help with IRULE
I need to create an IRULE that will detect certain /foldernames and sent it to a pool, if none of the foldernames exist then send to a different pool. Should I use the same VIP for this, or use 2 separate VIPs? For Example:
if http request is
www.domain.com/folderA
www.domain.com/folderB
www.domain.com/folderC
www.domain.com/folderD
go to pool name "betatest"
else go to
pool name "legacytest"
Please help
7 Replies
- Give this a shot:
when HTTP_REQUEST { switch -glob [HTTP::uri] { "/folderA*" - "/folderB*" - "/folderC*" - "/folderD*" { pool "betatest" } default { pool "legacytest" } } }
Let us know if anything else comes up!
-Joe - Joe_Pena_46781
Nimbostratus
Awesome! is it safe to use the same VIP, then apply the irule to that VIP?
Thank you very very much - dennypayne
Employee
Hi,
Not exactly sure what you mean about using different vips, you need to use that rule on the vip that corresponds to the address that www.domain.com resolves to and the port the application uses. You can't have different vips with the same address and same port, so there would be no way to split this logic across different vips unless the app uses different ports or you've got multiple addresses in DNS for the domain.
Denny - Joe_Pena_46781
Nimbostratus
thank you Denny. I will give this a shot ina test environment - Joe_Pena_46781
Nimbostratus
I am getting an error when trying to save the irule logic, error: line 11: [undefined procedure: default] [default { pool oldsite.bankrate.com_pool }]........Here is my irule below. Can someone help me please?
when HTTP_REQUEST {
switch -glob [HTTP::uri] {
"/newfolderA*" -
"/newfolderB*" -
"/folderC*" -
"/folderD*" {
pool "newsite.bankrate.com_pool"
}
}
}
default {
pool "oldsite.bankrate.com_pool"
} - dennypayne
Employee
The default statement needs to be nested under the switch, you've got too many close braces in between so it's treating it as a separate command (which isn't valid).when HTTP_REQUEST { switch -glob [HTTP::uri] { "/newfolderA*" - "/newfolderB*" - "/folderC*" - "/folderD*" { pool "newsite.bankrate.com_pool" } default { pool "oldsite.bankrate.com_pool" } } }
Denny - Joe_Pena_46781
Nimbostratus
Great that did it
thanks
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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