Forum Discussion

Krys_Frankiewic's avatar
Krys_Frankiewic
Icon for Nimbostratus rankNimbostratus
Mar 20, 2015

L7 load balancing by content

We are migrating from cisco ACE. In Ace we specify class-map to use L7 load balancing as follow: class-map type http loadbalance match-all L7- 2 match http url /XDSOAPRouter/is/* class-map type http loadbalance match-any L7- 2 match http url /XDSOAPRouter/cx/.* Each content 'is' & 'cx' gow to a different pool. How can we achive that on F5?

 

11 Replies

  • Hi Janek, I implemented following iRule but all HTTP requests are going to the default pool SYSLOG3_pool which is set under Virtual Services Resources. How to make sure that iRule has a priority over the default pool?

     

    when HTTP_REQUEST {

     

    if { [HTTP::path] starts_with "/XDSOAPRouter/8t" } { pool SYSLOG_pool } if { [HTTP::path] starts_with "/XDSOAPRouter/cx" } { pool SYSLOG1_pool } if { [HTTP::path] starts_with "/XDSOAPRouter/is*" } { pool SYSLOG3_pool } }

     

  • Hi Krys

     

    From 5000 feet, it looks like you're missing "elseif" and "else" expressions. Have you tried it with those in place?

     

    Bernie

     

  • Hi Bernie, I tried "esleif", still is not working. I can't have "else" pointing to the default pool. In my case each request must be forwarded to the right pool. All my requests are going to SYSLOG1_pool which is a default pool under virtual servers.

     

    when HTTP_REQUEST {

     

    if {[HTTP::path] starts_with "/XDSOAPRouter/8t" } { pool SYSLOG_pool

     

    } elseif {[HTTP::path] starts_with "/XDSOAPRouter/cx" } { pool SYSLOG1_pool } elseif {[HTTP::path] starts_with "/XDSOAPRouter/is*" } { pool SYSLOG3_pool } }

     

  • Is this correct? Because I'm getting error. if {[HTTP::path] starts_with "/XDSOAPRouter/8t" }then{ pool SYSLOG_pool

     

    } elseif {[HTTP::path] starts_with "/XDSOAPRouter/cx" }then{ pool SYSLOG1_pool } elseif {[HTTP::path] starts_with "/XDSOAPRouter/is*" }then{ pool SYSLOG3_pool } }

     

    01070151:3: Rule [/Common/L7-test] error: /Common/L7-test:2: error: [parse error: extra characters after close-brace][then{ pool SYSLOG_pool } elseif {[HTTP::path] starts_with "/XDSOAPRouter/cx" }then{ pool SYSLOG1_pool } elseif {[HTTP::path] starts_with "/XDSOAPRouter/is" }then{ pool SYSLOG3_pool }] /Common/L7-test:4: error: [parse error: extra characters after close-brace][then{ pool SYSLOG1_pool } elseif {[HTTP::path] starts_with "/XDSOAPRouter/is*" }then{ pool SYSLOG3_pool }] /Common/L7-test:6: error: [parse error: extra characters after close-brace][then{ pool SYSLOG3_pool }]

     

  • Yeah that's wrong then :( The previous one looked better. I'll see if I can try it out real fast tomorrow

     

  • Now is working:)

     

    when HTTP_REQUEST {

     

    if { [HTTP::path] starts_with "/XDSOAPRouter/8t" } { pool SYSLOG_pool } if { [HTTP::path] starts_with "/XDSOAPRouter/cx" } { pool SYSLOG1_pool } if { [HTTP::path] starts_with "/XDSOAPRouter/is" } { pool SYSLOG3_pool } }

     

  • It could be the wildcard, I will teset later and let you know my findings. Thanks for help.