QuestionQ48

VerifiedIdentify and Resolve LTM Device Issues

A virtual server for a group of web services is configured on an LTM device. The LTM Specialist created an iRule and applied it to the virtual server:

when HTTP_REQUEST \{  
    switch [HTTP::uri] \{  
        "/ws1/ws.jsp" \{  
            log local0. "[HTTP::uri]-Redirected to JSP Pool"  
            pool JSP  
        \}  
        default \{  
            log local0. "[HTTP::uri]-Redirected to Non-JSP Pool"  
            pool NonJSP  
        \}  
    \}  
\}  

However, the iRule is not behaving as expected. The following is a log snapshot:

/WS1/ws.jsp-Redirected to JSP Pool  
/WS1/ws.jsp-Redirected to JSP Pool  
/WS1/ws.jsp-Redirected to JSP Pool  
/WS1/WS.jsp-Redirected to Non-JSP Pool  
/ws1/WS.jsp-Redirected to Non-JSP Pool  
/WS1/ws.jsp-Redirected to JSP Pool  
/ws1/ws.jsp-Redirected to Non-JSP Pool  

What should the LTM Specialist do to resolve this?

Explanation

Tcl switch matching against literal values is case-sensitive unless the compared value or matching behavior is made case-insensitive. Applying string tolower to HTTP::uri before the switch normalizes every capitalization variant to lowercase, allowing it to match the lowercase /ws1/ws.jsp case and select the JSP pool. F5’s iRules documentation shows URI/path routing patterns that use switch with string tolower for case-insensitive matching.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!