Forum Discussion

Pedro_Haoa_7122's avatar
Pedro_Haoa_7122
Historic F5 Account
Jul 03, 2017

BIG-IP APM Variables

Hi,

From the following iRule:

when ACCESS_POLICY_AGENT_EVENT {
    set m1 [ACCESS::session data get "session.machine_info.last.net_adapter.list.\[0\].mac_address"]
    set m2 [ACCESS::session data get "session.machine_info.last.net_adapter.list.\[1\].mac_address"]
    set c class
    set m match
    set a ACCESS::session
    set d data
    set t set
    set s "session.logon.cstm.chk"
if {[$c $m $m1 eq DG1]||[$c $m $m2 eq DG1]} { $a $d $t $s 1 }
elseif {[$c $m $m1 eq DG2]||[$c $m $m2 eq DG2]} {$a $d $t $s 1}
else {$a $d $t $s 1}
}

How can I concat/merge the $c and $m variables into one?

How could concat/merge the variables $a, $d, $t and $s into one?

My goal is to get as few characters as possible.

Thanks!

  • Hi,

     

    Why do you want to create these variables?

     

    You can try this code

     

    when ACCESS_POLICY_AGENT_EVENT {
        set m1 [ACCESS::session data get "session.machine_info.last.net_adapter.list.\[0\].mac_address"]
        set m2 [ACCESS::session data get "session.machine_info.last.net_adapter.list.\[1\].mac_address"]
        Set cstm_chk [expr {[class match $m1 eq DG1]||[class match $m2 eq DG1]||[class match $m1 eq DG2]||[class match $m2 eq DG2]}]
        ACCESS::session data set session.logon.cstm.chk $cstm_chk        
        unset cstm_chk m1 m2
    }
  • Hi Stanislas,

     

    For some reason, I couldn't see your reply post. Can you send it again?