Eric_Frankenfie
Dec 16, 2013Nimbostratus
Logging Variables
I have an iRule which performs the following: 1. Read the contents of the XML through an XML profile 2. Sets the variable 'id' to $XML::values($I) 3. If the value equals an entry in the data group, sends the traffic to pool_A 4. Else, sends the traffic to pool_B 5. Logs the variable 'id' and the pool member the traffic was sent to
This is the iRule:
when XML_CONTENT_BASED_ROUTING
{
for {set i 0} { $i < $XML::count } {incr i} {
set id $XML::values($i)
if { ([matchclass $XML::values($i) equals DataGroup_by_Org])} {
pool pool_A
} else {
pool pool_B
}
}
}
when LB_SELECTED {
log local0. "3189: orgName $id sent to [LB::server addr]"
}
I am having an issue with the logging portion. When I look at the log entry, the variable can't be read. This is the entry in the logs:
Dec 15 14:39:09 local/tmm1 err tmm1[21886]: 01220001:3: TCL error: Routing_by_Org - can't read "id": no such variable while executing "log local0. "3189: orgName $id sent to [LB::server addr]""