Hello Selva and welcome to the Community!
It sounds like you're really needing an automated, hands-off approach that doesn't require a human to review an audit log to find when a user last logged in. With that said, there is a feature request to add this 'lastLogin' field to the '/rest/api/2/user?username=userName' endpoint. You may find this request at ID-6965.
We would ask you to vote and watch the above issue to receive updates on its status.
Alternatively, you could review Atlassian Access to approach the issue differently, though it may not fit into your workflow perfectly. More information on access, if you're interested, can be found here:
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event
You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events