- When using the GUI page "Monitor/Clients and Users" if you filter on profile name 'voice' you get 3,652 results which is about right.
- If you use an API call on /data/ClientSessions?profileName="voice"&.maxResults=20000 you get 20,000 results of which vast majority are duplicates (client MAC).
- You are guessing this call is showing the historical sessions as well as current/latest 'live' sessions. You don't see any parameter related to connection status to filter on to only return current or latest session data so you can get the same results as via the GUI .
- Running PI 3.1.4.
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.
- Is it possible to combine multiple filters using both 'and' and 'or' matching. For example if you want to use ClientSessions to return ((profileName="voice" OR vlan="101") AND policyTypeStatus="RUNNING") so that you retrieve only active sessions but need to catch endpoints either in vlan 101 or using profile name voice.Or better off collecting all the associated sessions first and then filtering.
Unfortunately, no, It is not supported. 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.
Would 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.