Forum Discussion
Deb_Allen_18
May 09, 2006Historic F5 Account
calling a command from a class
I'm building lots of variations on a theme for redirects, and would like to be able to use dynamic request variables to build redirect responses.
I was hoping to use command strings stored in a cl...
Colin_Walker_12
May 11, 2006Historic F5 Account
Try adding an eval line in your rule.
Like this:
rule HostRedirects {
when HTTP_REQUEST {
set row [findclass [getfield [HTTP::host] ":" 1] $::HostRedirects]
if { not ($row eq "")}{
set tmpRow [eval $row]
HTTP::respond [getfield $tmpRow " " 2] Location [getfield $tmpRow " " 3]
unset row
unset tmpRow
return
}
}
}That should get the HTTP::uri command to evaluate for you. You might also want to add some logging to see what each of your getfield commands are returning if you have further problems.
Colin
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