Forum Discussion
JRahm
Jun 25, 2020Admin
As an alternative, many are unaware of the matches_glob operator, which would be of great use in this case:
when HTTP_REQUEST {
if {[HTTP::uri] matches_glob {*test[123]*} } {
pool ONPREM
} else { pool CLOUD }
}
Not only does it simplify the condition, but it reduces the character count to be stored, and it also saves a few thousand CPU cycles per iteration compared to the other solution.
Another thing I'd note is the URI is if you want this to be case insensitive, you can either change your glob match for the test characters, or easier, use string tolower around the URI command.
i featured this question on the You Want Answers?!?! live stream, check it out!