Forum Discussion

Tom_B_90541's avatar
Icon for Nimbostratus rankNimbostratus
Mar 26, 2012

irule too long

Greetings all. 9.4.X irule issue. We seem to have hit the character limit (KB SOL9204). Our irule looks like this:





if {[HTTP::uri] starts_with "/test"} {pool pTest}


elseif {[HTTP::host] == ""} {pool pClienta}


elseif {[HTTP::host] == ""} {pool pClientb}



and it continues with a new "elseif" statement for each client. We have been able to free some space by removing a couple redundant or unnecessary lines, and that helps for the next week or so, but we need a long-term solution. I hope to avoid creating another virtual server. I have seen you can assign multiple irules to a virtual server, but I have not yet been successful in testing to get it to work. In a situation like the irule above, is it possible to have multiple irules? How would you make it work? Thanks in advance for any advice.

2 Replies

  • Hi Tom,



    The best option would be to move the hostname to pool name mappings to a data group. In 9.4.x you could use findclass to look up the requested host header in the data group and return the pool name.





    A less ideal option would be to replace the if/elseif/elseif.../else chain with a switch statement. This should save you some characters in the iRule.





  • Thanks hoolio. I'll check these out and see which option may work best in my environment.