Forum Discussion
Need to verify the iRule to replace HTTP Class
Hello Folks,
Seek for your quick help. I am working on a upgrade activity for one of the customers from 11.2.1 to 11.5.1. Where they have one HTTP Class containing RegEx, which isn't migrating to the latest release.
The HTTP Class looks as the following screenshot.
The iRule I have prepared looks as following, to serve the same purpose as HTTP Class. Could someone please confirm if it looks correct or require any modification?
when HTTP_REQUEST {
if {[HTTP::uri] matches_regex {"(?i)/testuri.*"} and [HTTP::header "header_sosproject"] contains "SOS_project"} {
pool pool_sos
}
}
Cheers! Darshan
I'm not certain what you are trying to match, but I think you have an error in your RegEx. I think you would want "(?i)/testuri.*" if you want to match any characters after /testuri The way you have it, it would match /testuri, or testurii, or /testuriiiii.
I realize that /testuri is just an example, but I still think you would want the .* at the end of your regex string.
- swo0sh_gt_13163Altostratus
Thanks Robert, Appreciated!
Updating the iRule snippet according to the suggestion, in case if someone want to use the similar example, would help.
Cheers! Darshan
Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com