Forum Discussion

fraandres's avatar
fraandres
Icon for Nimbostratus rankNimbostratus
Mar 17, 2023

iRule Sideband datagroup

Hello pretty new to creating iRules specially sidebands, what I want to accomplish is get an IP from an APM session and drop it on a datagroup with a sideband. This is what I have below not sure if I'm in the right path

 

when ACCESS_POLICY_COMPLETED {
set clientip [ACCESS::session data get "session.user.clientip"]
set send_info [send -timeout 1000 -status send_status $conn_id $clientip]
send data [send"/mgmt/tm/ltm/datagroup/internal/active_visitor_ips\?options=\/"$clientip/""]

#set data [send PATCH {"op": "add", "path": "/mgmt/tm/ltm/datagroup/internal/active_visitor_ips\&options\=$clientip/-", "value": "$clientip" }]



}

when ACCESS_SESSION_CLOSED {
set clientip [ACCESS::session data get "session.user.clientip"]

}

  • xuwen's avatar
    xuwen
    Icon for Cumulonimbus rankCumulonimbus

    Why not store the client IP address in the irules table or use HSL send client ip to syslog server?

    You keep modifying the datagroup through the icontrolrest API will cause F5 icontrolrest api error and restjavad busy

    and in tcl, you need to  escape special characters in json or dict, such as { or "