Forum Discussion

Khanh_vo_213579's avatar
Khanh_vo_213579
Icon for Nimbostratus rankNimbostratus
Apr 28, 2016

iRule Not Sending Request to Correct Pool

I have an iRule:

 

when HTTP_REQUEST { log local0. "uri info: [HTTP::uri]" switch -glob [string tolower [HTTP::uri]] { "/webservice1*" { pool ws_pool1 } "/webservice2" { pool ws_pool2 } default { pool ws_pool3 } } }

 

which is suppose to send the requests to the specific pools but for some reason is only sending requests to the default pool. This is what gets logged:

 

Thu Apr 28 10:00:15 CDT 2016infotestloadbaltmm[10179] Rule /Common/ESBEndPoint : uri info: /webservice1 Thu Apr 28 10:00:17 CDT 2016infotestloadbaltmm[10179] Rule /Common/ESBEndPoint : uri info: /webservice1

 

Am I missing some configuration somewhere?

 

2 Replies

  • Hi,

    I don't see any error in the irule.

    you can try to log selected pool after switch:

    when HTTP_REQUEST {
        log local0. "uri info: [HTTP::uri]"
        switch -glob [string tolower [HTTP::uri]] {
            "/webservice1*" { pool ws_pool1 }
            "/webservice2" { pool ws_pool2 }
            default { pool ws_pool3 }
            log local0. "pool info: [LB::server pool]"
        }
    }
    
  • Logging the pool clued us in on why it didn't work. It turned out the URI that we were checking against was not all lower case. Silly mistake.