06-Jun-2022 09:50
Hi everyone,
I have an irule with a static variable "set example 1" which is used when we need to point to a specific virtual server, and we change it to "Set example 0" when we want to move the traffic to another virtual server, the thing is now we have many irules and when we want to move the traffic we need go one by one and change the variable, I am thinking of setting the variable with a data group where we just need to go there and change the value in the datagroup "1" or "0", is it possible? or there are any other option?
29-Jul-2022 13:30
You probably have figured it out by now but just in case, here's an example.
Data group list:
ltm data-group internal /Common/select_server {
records {
server {
data a
}
}
type string
}
And the rule:
when HTTP_REQUEST {
# Below is the droid... I mean line you're looking for
set selected_server [class lookup "server" select_server]
HTTP::respond 200 content $selected_server
}
Good luck!
Kind regards,
Patrik