Splunk Search

How to determine working duration of user on Change or Authentication datamodel?

abhishekkalokhe
Explorer

Hello,

Right now I am struggling to identify the working hours of user by Application based on Change or Authentication datamodel.

the main objective is to determine the standard working time of each user, and if that user perform any activities outside of that working time then alert will trigger.


Below are the queries :-
| tstats `summariesonly` c as changes_count earliest(_time) as et latest(_time) as lt from datamodel=Change by All_Changes.user All_Changes.vendor_product index _time span=1d
| `drop_dm_object_name(All_Changes)`
| eval time_diff=((lt-et)/60/60)
| search time_diff!=0
| convert ctime(et) ctime(lt)


| tstats `summariesonly` values(Authentication.signature) as signature values(sourcetype) as sourcetype latest(_time) as lt earliest(_time) as et from datamodel=Authentication.Authentication where (Authentication.is_Successful_Authentication=1)  by Authentication.user Authentication.app index _time span=1d
| `drop_dm_object_name("Authentication")`
| eval time_diff=((lt-et)/60/60)
| convert ctime(lt) ctime(et) 
| dedup user


Now real challenge is time, some user works in different timezones and some might be working overnight.

Labels (1)
Tags (4)
0 Karma

tscroggins
Influencer

@abhishekkalokhe 

Are you sure either model provides the information you need?

Change is intended to track state changes, which may include logging in and logging out, i.e. "create" session and "delete" session.

Authentication is intended to track independent authentication attempts.

Can you provide generalized examples of your input events?

abhishekkalokhe
Explorer

@tscroggins 

I agree its difficult to find duration based on Authentication logs.

Ill try working with Change DM, can you provide me any general logic to identify duration/working time by User.

0 Karma
Get Updates on the Splunk Community!

Detecting Remote Code Executions With the Splunk Threat Research Team

REGISTER NOWRemote code execution (RCE) vulnerabilities pose a significant risk to organizations. If ...

Observability | Use Synthetic Monitoring for Website Metadata Verification

If you are on Splunk Observability Cloud, you may already have Synthetic Monitoringin your observability ...

More Ways To Control Your Costs With Archived Metrics | Register for Tech Talk

Tuesday, May 14, 2024  |  11AM PT / 2PM ET Register to Attend Join us for this Tech Talk and learn how to ...