Forum Discussion

AlgebraicMirror's avatar
AlgebraicMirror
Icon for Altostratus rankAltostratus
Mar 17, 2016

Is there any way to get a list of active APM sessions from an iRule?

Is there any way to get a list of all the active APM sessions when I'm in an iRule? I'm basically looking for a list of session IDs on the system, because if I had that I could go through each session and search its variables for a specific characteristic.

 

As an example of the kind of thing I would like to: I would like to search through each session until I find the one with a certain client IP address. Then when I am working with connections, I would know who the user is if they have an active session somewhere else on the box (yes, I know that wouldn't be foolproof if multiple users were coming through a proxy, but this is internal only so I can guarantee every client that hits my F5 has a unique IP address).

 

2 Replies

  • Since iRule are fired on an event for a specific connection I am not really sure why you would need to search through all sessions for each connection. Why not just look for each specific APM Session (per connection) if you want to find if a variable exists?

     

    You can get session variables using the following article to help out.

     

    https://devcentral.f5.com/wiki/iRules.ACCESS__session.ashx

     

    Maybe I am not fully following what you are trying to do.

     

    Seth

     

  • Lucas_Thompson_'s avatar
    Lucas_Thompson_
    Historic F5 Account

    No, it's not possible. You can grab them on the command line (sessiondump or talk to sessiondb) but you can't do that from an irule.

     

    For your case, you'd be better off setting a subtable entry from an irule when the APM session begins. Then you can list or match that later on when you need it in the other rule.