F5 is upgrading its customer support chat feature on My.F5.com. Chat support will be unavailable from 6am-10am PST on 1/20/26. Refer to K000159584 for details.

Forum Discussion

Claude_Chouinar's avatar
Claude_Chouinar
Icon for Nimbostratus rankNimbostratus
Jan 12, 2014

iRule for specific URL to be sent to singel node in the pool

Hello, We are looking to direct traffic based on a specific URL to a single node in our pool.

 

Does anyone know the best way to accomplish this task?

 

Thank you, Claude Chouinard

 

2 Replies

  • This is what I have come up with. when HTTP_REQUEST { if { [string tolower [HTTP::uri] equals http://www.companyname.com/images/alp/captchaImages] } { pool 'pool_name' member 10.10.10.65 80 } } This is the error I receive using the iRule Editor Exception caught in LocalLB::urn:iControl:LocalLB/Rule::create() Exception: Common::OperationFailed primary_error_code : 17236305 (0x01070151) Any help would be appreciated. Thanks secondary_error_code : 0 error_string : 01070151:3: Rule [/Common/iRuler_Parse_Test_Rule] error: /Common/iRuler_Parse_Test_Rule:2: error: [invalid index: should be integer or "end"][equals] /Common/iRuler_Parse_Test_Rule:2: error: [invalid index: should be integer or "end"][http://www.alphabroder.com/images/alp/captchaImages]
  • A few syntactical errors:

    1. Your [string tolower ] command should only be encapsulating the HTTP::uri, not the entire string.

      [string tolower [HTTP::uri]]
      
    2. Your URL should probably be in double quotes.

    3. The [HTTP::uri] command is only going to retrieve the URI portion of the URL, so it would see

      /images/alp/captchaImages
      
    4. You don't need to encapsulate the pool name in single quotes.

    So assuming you don't really care about the Host portion of the URI, something like this should work for you:

    when HTTP_REQUEST {
        if { [string tolower [HTTP::uri]] equals "/images/alp/captchaImages" } {
            pool pool_name member 10.10.10.65 80
        }
    }