Track when a user logins

Linda Kendrick
Kilo Guru

Created a new u_user_login table that wanting to track everytime a user logs in. I need to run reports to see how many times a person/dept is logging inot the instance.

I created a business rule on the new table with the following settings:
When:after
Insert:yes
Active:yes
Script
var gr = new GlideRecord("u_user_login");

if (current.operation() == 'login')
{
gr.sys_created_by = event.parm1;
gr.sys_created_on = event.parm2;
}

I used the default columns that were created with the table as I just need to track the user and the date.
I am not sure if I am using the current.operation correctly and I am not seeing a record getting inserted into the new table.

11 REPLIES 11

Can I get the user_agent field from Client Transactions in this table somehow? The event. are coming from the sysevent table but the user_agent is in the Client Transactions. When I look at the dictionary for System Logs > Events the table is sysevent. So how do I know what Client Transactions should be? Would like to track what browser the user is using.


Hi Linda,



did you manage to get a solution for this?



Regards


No, I was not able to get the browser. Since this has been implemented, seeing who has logged in has been very useful and not needed the browser information.


Hi Linda,

Have you ever improved this tracking and added browser information today?

No I did not add browser. We use google analytics and can get browser information.