Forum Discussion
Yann-Arzel_9990
Nimbostratus
Nov 26, 2013Variable issue with iRule generated by IAPP
Hello,
I try to use an IAPP for setting up an iRule but I did not managed it when a variable is set on the iRule
Code :
proc create_iRule { irule_name } {
set irule_buffer [stri...
wuench_99164
Altocumulus
Aug 23, 2017With a little digging through the existing templates this is the answer I found. You have to do a string replacement on a variable then it will take it:
set APP_NAME $tmsh::app_name
set ST_RULE {
when HTTP_REQUEST {
if { ([active_members -smoketest-pool] >= 1) and
([HTTP::header "smokeTestMode"] contains "enabled") }{
pool -smoketest-pool
}
}
}
tmsh::create ltm rule ${RULE_NAME} \
[string map " $APP_NAME" $ST_RULE]
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