Forum Discussion
Livius
Cirrus
Jan 19, 2017Error code when no conditions match in iRule
Hi, I have the following iRule atached to a default HTTP profile ltm rule /Common/test1_iRule {
when RULE_INIT
{
set static::RoutingInfo "test1"
log local0. "----------------------...
JG
Cumulonimbus
Jan 20, 2017Would this work for you?
ltm rule /Common/test1_iRule {
when RULE_INIT {
log local0. "------------------------------ INIT ------------------------------------"
}
when XML_CONTENT_BASED_ROUTING {
set ValueFound 0
set RoutingInfo "0"
for {set i 0} { $i < $XML_count } {incr i} {
Routing by RoutingLabel
log local0. "XML_queries $XML_queries($i)"
log local0. "XML_values $XML_values($i)"
if { ($XML_queries($i) contains "RoutingLabel")} {
if { ($XML_values($i) eq "test1")} {
pool test1_p
set RoutingInfo "test1"
set ValueFound 1
break
} elseif {($XML_values($i) eq "test1_encr")} {
pool test1_encr_p
set ValueFound 1
set RoutingInfo "test1_encr"
break
} elseif {($XML_values($i) contains "SOAPtest")} {
pool test1_sim_p
set RoutingInfo "SOAPtest"
set ValueFound 1
break
} elseif {($XML_values($i) contains "test2")} {
pool test2_p
set ValueFound 1
set RoutingInfo "test2"
break
}
}
}
log local0. "RoutingInfo is $RoutingInfo after selecting pools"
}
when LB_FAILED {
if { $ValueFound == 0 } {
HTTP::respond 422 Connection close
}
}
}
?
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