naladar_65658
Sep 09, 2008Altostratus
Can you refer to a data group from within a switch?
Is it possible to refer to a data group from within a switch? Also, a big thank you to Joe for helping me get this far! You guys are awesome. I have only been at this about a week, but I have learned a ton by reading posts and wiki's here on the f5 site!
Here is a working code snippet:
switch -glob [string tolower [HTTP::uri]] {
"/fc/*" -
"/wpi/*" {
pool WWW2_Pool
}
default {
pool WWW3_Pool
}
Is it possible for me to put those strings into a string type data group (we will call it WWW2_uri) and just call the data group instead of each string? Maybe something like this?:
switch -glob [string tolower [HTTP::uri]] {
$::WWW2_uri {
pool WWW2_Pool
}
default {
pool WWW3_Pool
}
}
I did read the Controlling Bots iRule in the wiki, but I was hoping there was a way to call the external data group without re-writing it in a long if/else statement.