Understood the concept.
Right now I’m using:
select count(DISTINCT calling_station_id) as sessions from radius_acct where (username = '%{Authentication:Username}') AND (NAD_IP = 'x.x.x.x' OR NAD_IP = 'x.x.x.x' OR NAD_IP = 'x.x.x.x' OR NAD_IP = 'x.x.x.x') AND end_time is null AND termination_cause is null AND (updated_at BETWEEN (now() - interval '1 hour') AND now());
is this the best query for detecting devices per username? If I understand correctly, if there is no active session within 1 hour, the counting will be reset back to ‘0’. Am I correct?