Forum Discussion
Allen_Yu_168758
Nimbostratus
May 27, 2016Redirecting iRule by URL depth
Hi,
There is a request from our biz users that redirecting packets according URL depth, just wondering if it can be achieved by iRule.
Much appreciate if anyone's feedback.
Example:
the r...
Yann_Desmarest
Cirrus
May 27, 2016Hi,
try this one instead, just tested and found I had an issue with the previous one :
when HTTP_REQUEST {
set lb_depth 0
set lb_len 0
set timeout 3600
set path [string tolower [HTTP::path]]
set depth [URI::path $path depth]
define the depth of the path for hash calculation
if { $depth < $lb_depth } {
set depth_path [URI::path $path 1 $lb_depth]
} else {
set depth_path [URI::path $path 1 $depth]
}
set len [string length $depth_path]
define the chars length to be processed for hash calculation
if { $lb_len > 0 and $lb_len < $len } {
binary scan [sha1 [string range $depth_path 0 $lb_len-1]] w1 key
} else {
binary scan [sha1 $depth_path] w1 key
}
persist uie $key $timeout
}
tpts6
Nimbostratus
May 31, 2016Thanks for your advice !! ^^
I will keeping study syntax how to merge into one irule or try another workaround. Due to developer/vendor have no idea on F5-irule, but they are not prefer to implement on backend servers.
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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