Forum Discussion

Tuso_373397's avatar
Tuso_373397
Icon for Nimbostratus rankNimbostratus
Dec 17, 2018

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?

No RepliesBe the first to reply