Forum Discussion

  • update, i create this irule:

    when ACCESS_SESSION_CLOSED {
     
        set sessionId [ACCESS::session data get session.user.sessionid]
        set startSession [ACCESS::session data get session.user.starttime]
        set endSession [clock seconds]
        set seconds = int($endSession - $startSession)
        set minutes = expr [$seconds / 60]
        set hours = expr [$minutes / 60]
        
        if { $minutes > 60 } {log local0. "the session duration is $hours hours" }
        
        else { log local0. "the session duration is $minutes minutes"}
     
    }

    but i receive this error:

    01070151:3: Rule [/Common/session_log] error: /Common/session_log:6: error: [wrong # args][set seconds = int($endSession - $startSession)]
    /Common/session_log:7: error: [wrong # args][set minutes = expr [$seconds / 60]]
    /Common/session_log:8: error: [wrong # args][set hours = expr [$minutes / 60]]

    what can be the cause?

    Thanks you