Learn F5 Technologies, Get Answers & Share Community Solutions Join DevCentral

Filter by:
  • Solution
  • Technology
code share

convert irule from if...else to switch

Problem this snippet solves:

we tested that using "switch" statements the irule takes less time to perform. So i tried to create a script in python in order to do the conversion from if...else to switch automatically. Of course i am still improving it adding everytime new statements.

How to use this snippet:

go to: https://repl.it/@pirusti/IruleConverterToSwitch in main.py there is the code put your original(if...else)irule to "input.txt" and in "output.txt" file after running the script you'll find the new irule with "switch" statement.