Forum Discussion
Calling commands by string / reflection
Hi Stephan,
I can confirm you're correct for 11.4.1 at least. I haven't built my iRule exactly but fiddled did a lot of testing. I can turn attributes like
HTTP::uri into variables just by set x "HTTP::uri" . then I can get the command HTTP::uri by $x . Alternatively if I do [$x] it returns the value of the HTTP uri.
I even did something like
when HTTP_REQUEST {
set a HTTP::header
set b "replace"
set c "host"
set d "new.host.header.value"
$a $b $c $d
}
And the last line actually replaced the host header.
I haven't been able to turn things like "starts_with" into variables though - every approach has resulted in a run time error but I think I've gotten around it by using
matches_glob for all string matching and leaving it up to the user to enter the correct wildcards into the datagroup that feeds into the iRule.
I think this is pretty much solved but I'll build my iRule when I get a chance again and repost in a couple of days with an update.
I'm quite sure this is going to cut my iRule down to a third of its size at least. Thanks for your help again!
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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