Forum Discussion
Reddy1
Altostratus
Mar 04, 2019URI Redirects with Data-groups
I have a simple requirement ,
- There are about 8 incoming URI's which has to be modified and send to the different pool.
- I have the Data-group created with the string (old uri) and value (new uri).
- The irule first assigns the variable old_uri with the incoming uri.
- The first IF condition checks if the old_uri equals to the string in the Data-Group.
- If the incoming URI matches to the Data-group , the variable new_uri will hold the string value. if {[class match $old_uri eq DATAGROUP]} { set new_uri [class match -value $old_uri eq DATAGROUP] HTTP::uri "$new_uri" pool $Test_pool } For some reason its not working !!!!!
- Reddy1
Altostratus
Can the below irule work?
if {[class search -name DATAGROUP contains [string tolower [HTTP::path]]]} { set new_path "[class match -value [string tolower [HTTP::path]] equals DATAGROUP]" HTTP::path "$new_path" log local0. " The new HTTP Path is [HTTP::path]" pool $Test_pool return }
Try this:
when HTTP_REQUEST { if { [class match [string tolower [HTTP::path]] contains DATAGROUP] } { set NEW_PATH [class match -value [string tolower [HTTP::path]] equals DATAGROUP] HTTP::path $NEW_PATH log local0. "The new HTTP Path is [HTTP::path]" pool $Test_pool return } }
Recent Discussions
Related Content
DevCentral Quicklinks
* 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
Discover DevCentral Connects