301B practice question 27 of 30

A virtual server for a set of web services is constructed on an LTM device. The LTM Specialist has created an iRule and applied this iRule to the…

Full set: 210 questions
A virtual server for a set of web services is constructed on an LTM device. The LTM Specialist has created an iRule and applied this iRule 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. Below is a snapshot of the log: /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?
Answer options
A: Use the followinG. switch -lc [HTTP::uri]
B: Use the followinG. switch [string tolower [HTTP::uri]] Correct answer
C: Set the "Case Sensitivity" option of each member to "None".
D: Select the "Process Case-Insensitivity" option for the virtual server.
Correct Answer:
B. Use the followinG. switch [string tolower [HTTP::uri]]
Explanation

The iRule's switch command performs a case-sensitive string comparison by default. The log file shows that requests with different capitalization (e.g., /WS1/ws.jsp vs. /ws1/ws.jsp) are being processed differently, with some falling into the default block incorrectly. To resolve this, the HTTP::uri value must be converted to a consistent case before the comparison. Using the string tolower command achieves this by converting the incoming URI to all lowercase, ensuring that it will match the lowercase string "/ws1/ws.jsp" in the switch statement regardless of the original capitalization.

Why Incorrect

A. The -lc flag is not a valid option for the switch command in TCL/iRules, making the syntax invalid.
C. A "Case Sensitivity" option does not exist for pool members; they are defined by IP address and port, which are not case-sensitive.
D. A "Process Case-Insensitivity" option is not a feature available on a standard LTM virtual server object.

References

- F5 Networks (2021). F5 iRules Home. F5 DevCentral. Retrieved from https://clouddocs.f5.com/api/irules/. See documentation for switch and string tolower commands. The switch command documentation specifies its default behavior is exact, case-sensitive matching.

- F5 Networks (2021). iRules 101 - #02 - Variables and #03 - If and Switch. F5 DevCentral. This article explains the basic operation of the switch command, which follows standard TCL behavior (case-sensitive).

Scroll to Top