Learn F5 Technologies, Get Answers & Share Community Solutions Join DevCentral

Filter by:
  • Solution
  • Technology
Answers

if else statement of XML content routing not working

Hi

I have an XML profile attached to a VS. Below is the iRule attached the to VS:

when XML_CONTENT_BASED_ROUTING
{ 
    for {set i 0} { $i < $XML_count } {incr i} {
    log local0. $XML_queries($i)
    log local0. $XML_values($i)
    if {($XML_queries($i) contains "MobileNumber")} { 
      if {($XML_values($i) eq "123456789")} {
     pool Pool1
  }
  else {
     pool [LB::server pool]
    }
  }
 }
}

The iRule is only working if the $XML_values($i) eq 123456789, any traffic with a different mobileNumber will NOT be directed to the default pool i.e pool [LB::server pool] . The VS has a default pool. So its like the else statement is not working. Any idea why it might not be working?

0
Rate this Question

Answers to this Question