Forum Discussion

Nick_Burnard_66's avatar
Nick_Burnard_66
Icon for Nimbostratus rankNimbostratus
Oct 24, 2017

irule Persist Lookup command with multiple persistency tables

Got a question on the irule persist lookup command which is driving me mad. I have a situation whereby a source address is in two different source address persistency tables depending upon the Virtual/Pool it is using.

 

I am trying to do a persist lookup in an irule based on the IP address and pool name to retrieve the correct entry but am failing completely.

 

When I do a "persist lookup source_addr x.x.x.x pool xxxxx" I get nothing returned.. If I do it with an "any" rather than the pool and poolname then I seem to only get the first entry returned to me in a list rather than them both which I was expecting.

 

Example Persistency table

 

tmsh show /ltm persistence persist-records mode source-address key "10.2.0.0"

 

source-address 10.2.0.0 any:443 192.168.112.13:any (slot/tmm: 2/6)

 

source-address 10.2.0.0 any:any 192.168.112.16:any (slot/tmm: 2/8)

 

source-address 10.2.0.0 any:443 192.168.112.13:any (slot/tmm: 2/9)

 

source-address 10.2.0.0 any:any 192.168.112.16:any (slot/tmm: 2/9)

 

source-address 10.2.0.0 any:443 192.168.112.13:any (slot/tmm: 2/7)

 

Result in the irule

 

[persist lookup source_addr 10.2.0.0 any] = /Common/ASM_Ingress 192.168.112.16 0

 

which is one correct entry which is more than I got when using "pool pool_name" but only the one. I must be doing something stupid but I cant see what for the life of me.

 

any suggestions greatly received

 

1 Reply

  • Hi Nick,

    take a look to the persist wiki page [click me]. You may notice that the the persist lookup command has a slightly counterintuitive notation. The command...

    persist lookup source_addr 1.1.1.1 pool MyPool
    

    ... must be formated like one of the following samples ...

    persist lookup source_addr {1.1.1.1 pool MyPool}
    persist lookup source_addr "[IP::client_addr] pool MyPool"
    persist lookup source_addr [list [IP::client_addr] pool [LB::server pool]]
    

    Let me know if this hint fixes your life... 😉

    Cheers, Kai