Forum Discussion

mihaic's avatar
Jan 27, 2015

Http class to irule conversion?

Does anyone know how to convert a http class to an irule. Starting with version 11.4 it seems http classes do not exist anymore. I need to convert a lot of http classes to an irule for a new device with version 11.6. Does anyone have a tool/script that does this?

 

  • So this is an example of a pool that does not get coverted to ver 11:

     

    pool pClient1 {

     

    monitor all gateway_icmp

     

    members 10.197.125.4:http

     

    }

     

    Output:

     

    pool pClient1

     

  • Okay, got it. Output syntax is not consistent. Here comes the fix:

    bigpipe pool list | \
    grep -oE '^(pool [^ ]+|[[:blank:]]+([0-9]+\.){3}[0-9]+:[[:alnum:]]+|[[:blank:]]+members ([0-9]+\.){3}[0-9]+:[[:alnum:]]+)' | \
    sed -r 's/members //g; s/([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+):([[:alnum:]]+)/\/Common\/\1:\2 { address \1 }/g' | \
    sed -r ':a;N;$!ba;s/\n[[:blank:]]+/ /g' | \
    sed -r 's/pool ([^ ]+) (.*)$/ltm pool \/Common\/\1 { members { \2 } monitor \/Common\/gateway_icmp }/g'
    
  • It works. :-)

     

    Thanks a thousand of times. Now i have to buy you a thousand of beers!