Forum Discussion

jemster_44692's avatar
jemster_44692
Icon for Nimbostratus rankNimbostratus
May 20, 2014

Table command not working between two different iRules on different VIPs

I am trying to use the table command to pass data between two different iRules but they only seem to be able to see their own table even though the key is the same. IRULE 1 set sess [IP::client_addr] set mydata "testing" table set $sess $mydata

 

iRule 2 set sess [IP::client_addr] set getdata [table lookup $sess] if {$getdata != ""} { do something here }

 

However, getdata always comes back empty.

 

5 Replies

  • this is mine.

     config
    
    root@(ve11a)(cfg-sync In Sync)(Active)(/Common)(tmos) list ltm rule myrule80
    ltm rule myrule80 {
        when CLIENT_ACCEPTED {
      set sess [IP::client_addr]
      set mydata "testing"
      table set $sess $mydata
      log local0. "[virtual name]: table set $sess $mydata"
    }
    }
    root@(ve11a)(cfg-sync In Sync)(Active)(/Common)(tmos) list ltm rule myrule81
    ltm rule myrule81 {
        when CLIENT_ACCEPTED {
      set sess [IP::client_addr]
      set getdata [table lookup $sess]
      log local0. "[virtual name]: set getdata \[table lookup $sess\] = [table lookup $sess]"
      if {$getdata != ""} {
          do something here
      }
    }
    }
    
     test
    
    [root@ve11a:Active:In Sync] config  tail -f /var/log/ltm
    May 19 18:33:48 ve11a info tmm[14715]: Rule /Common/myrule80 : /Common/bar80: table set 172.28.24.1 testing
    May 19 18:33:52 ve11a info tmm[14715]: Rule /Common/myrule81 : /Common/bar81: set getdata [table lookup 172.28.24.1] = testing
    
    
  • Is it at all possible that you have a race condition - the possibility that you're trying to read the value before it's been set? Do you have a priority defined in each event declaration? Or do you have the iRules applied in a specific order in the GUI (v11)?