How to use Lists in iRule
I'm trying to do a redirect to a specific node for a specific set of sites using our F5. I can do a single site easily using the following irule:
when HTTP_REQUEST {
if { [string tolower [HTTP::host]] ends_with "site1.mysite.com" } {
node 10.1.1.31
}
}
And for a single site this is fine. My problem is I need to do this for about ~130 sites, and want to manage a list of sites that is called in the irule as these sites that are being redirected might be changed over time.
I created a list in my partition under System --> File management --> iFile List called MyList that was imported from MyList.txt on my local machine.
I then went to Local Traffic --> iRules --> Data Group List and created MyList as a string. I tried to add it as an address list, but got the following error:
The requested class IP item (/LB_Stage_Web/MyList 10.XXX.XXX.XXX%1 255.255.255.255) already exists in partition LB_Stage_Web.
So I'm just really wondering how I can use the list functionality to get this to work.