cancel
Showing results for 
Search instead for 
Did you mean: 
Login & Join the DevCentral Connects Group to watch the Recorded LiveStream (May 12) on Basic iControl Security - show notes included.

Irule log session time

Satoshino
Cirrus
Cirrus

Hi everyone,

 

I am looking for a way to log, when it is close, a duration of an APM session via irule, do you know if it is possible to do this?

 

Thanks you

1 REPLY 1

Satoshino
Cirrus
Cirrus

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