Forum Discussion
Paul_Slosberg_8
May 17, 2007Historic F5 Account
A better way
Greetings,
Im trying to grab the last octect of the client adress so I can then use that to send the thraffic to the proper pool. I will have 254 pools that I need to send traffic too. Im trying t...
hoolio
Cirrostratus
May 17, 2007You could use a switch statement on the string length of $port_info to avoid using a regex. The string length command is more efficient than the regex comparison.
...
switch [string length $port_info] {
1 { pool $poolname400$portinfo }
2 { pool $poolname40$portinfo }
3 { pool $poolname4$portinfo }
}If you do stick with the regex, I think you'll need to adjust the comparisons. [10-99] would mean match a single character that's either 1, 0 through 9, or 9. Likewise [100-254] would match a single character that's either 1, 0, 0 through 2, 5 or 4.
Else, if you wanted to avoid using a rule altogether, you might be able to use the least connections load balancing method to ensure the load is distributed evenly, with source address persistence to ensure clients are sent to the same node. You'd need to add all of the nodes from the current 254 pools into one pool though.
Aaron
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
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