Forum Discussion
The_Bhattman
Jun 13, 2011Nimbostratus
Hi Bob,
There are 2 ways to go about this. You can use the switch statement if there is small list of paths you want to check for or you can can use class objects
Here is the switch command
when HTTP_REQUEST {
switch -glob [string tolower[HTTP::path] ] {
"/mcbob*" -
"/path2*" -
"/path3*" {
pool secure2.mydomain.com
}
default {
pool secure2.mydomain.com
}
}
}
Or you can use datagroups which works well when you have lots of different paths you want to take into account
class mypaths {
"/mcbob"
"/path1"
"/path2"
"/path3"
}
when HTTP_REQUEST {
if {[class match -value [string tolower [HTTP::path]] starts_with "mypaths" ] } {
pool secure2.mydomain.com
} else {
pool secure.mydomain.com
}
}
Note: This is untested code
I hope this helps
@Bhattman