01-25-2017 08:17 AM
Hello,
When using the GUI page "Monitor/Clients and Users" if I filter on profile name 'voice' I get 3,652 results which is about right. If I use an API call on /data/ClientSessions?profileName="voice"&.maxResults=20000 I get 20,000 results of which vast majority are duplicates (client MAC). I'm guessing this call is showing me historical sessions as well as current/latest 'live' sessions? I don't see any parameter related to connection status to filter on to only return current or latest session data so I can get the same results as via the GUI - any help appreciated.
Running PI 3.1.4.
Thanks,
Dave
Solved! Go to Solution.
01-25-2017 09:04 AM
Yes, the GET data/ClientSessions resource shows all client sessions that have not yet been pruned from the PI database. To see which clients are live and which are not, you can use either the sessionEndTime parameter to identify sessions that have ended or the policyTypeStatus to see which clients are DISASSOCIATED and which are not.
01-25-2017 09:04 AM
Yes, the GET data/ClientSessions resource shows all client sessions that have not yet been pruned from the PI database. To see which clients are live and which are not, you can use either the sessionEndTime parameter to identify sessions that have ended or the policyTypeStatus to see which clients are DISASSOCIATED and which are not.
01-25-2017 11:49 PM
Thanks Spencer,
One more question then if I may - can I combine multiple filters using both 'and' and 'or' matching? For example if I want to use ClientSessions to return ((profileName="voice" OR vlan="101") AND policyTypeStatus="RUNNING") so I retrieve only active sessions but need to catch endpoints either in vlan 101 or using profile name voice? Or am I better off collecting all the associated sessions first and then filtering that myself?
Cheers,
Dave
01-26-2017 09:04 AM
Unfortunately, no, we don't support this. You can either have all the filter criteria ANDed together (the default behavior). Or you can specify .or_filter=true and have them ORed together. But you can't mix and match.
I'd recommend either sweeping up all of the client sessions into your own data warehouse, indexing the values of interest to you, then doing your filtering there. Alternatively, you could use OR filters to ensure you get every possible match, then drop the ones that don't meet your filter expression precisely.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide