Manual Chapter : Sharing iRule variables between connections

Applies To:

Show Versions Show Versions

BIG-IP LTM

  • 15.1.0, 15.0.1, 15.0.0, 14.1.2, 14.1.0, 14.0.1, 14.0.0, 13.1.3, 13.1.1, 13.1.0
Manual Chapter

Sharing iRule variables between connections

MRF does not join the client side connection with the server side connection (except for SIP ALG). The traditional method of using the CLIENTSIDE or SERVERSIDE keywords to access variables will not work. Instead MRF provides a command to deliver tcl variables along side of the message to the outgoing connection. The MR::store command allows the script author to specify which tcl variables should be delivered to the outgoing connection. The MR::restore command unpacks the delivered variables on the outgoing connection and adds them to the connections context.
For example on the incoming connection:
when MR_INGRESS { set originator_ip [IP::remote_add] set ingress_message_count [expr $message_count + 1] MR::store originator_ip ingress_message_count }
On the outgoing connection:
when MR_EGRESS { MR::restore log local0. "originator_ip $originator_ip ingress_message_count $ingress_message_count" }