Splunk Search

How to write searches for these specific use cases for my data?

Nayakstar
New Member

Below is the log format 😞 log sample)

   ID      swipe_status               date                  time                    location
362558     SwipeIn                    2017-01-01            05:00:00.466            USA

Index = Swipe_index

  1. Total time between the swipe in & the swipe out for a user 1.1. List of users who were present in the organization for '9' or more than '9' hrs. (i.e. Time between swipe in and swipe out >= 9 hrs)
  2. List of users who have multiple instances of swipein & swipeout 2.1. Total time between first swipe in and last swipe out for all users who have multiple instances of swipe-in & swipe- out 2.2. List of users whose total time between first swipe in and last swipe out is '9' or more than '9' hrs 2.3. List of users whose total time between first swipe in and last swipe out is less than '9' hrs
  3. List of users who have requested an access on weekends
Tags (2)
0 Karma
1 Solution

nabeel652
Builder

Really hard to explain without the relevant data. However:

All your queries can be written using "transaction" command. https://docs.splunk.com/Documentation/Splunk/6.5.1/SearchReference/Transaction

  • You are looking at bundling your results using transaction command by EmployeeID. Transaction command gives you the duration automatically. Something like this index = Swipe_index | transaction EmployID maxevents=-1 maxspan=-1 startswith = "SwipeIn" keeporphans=true | where duration > 540 (for 9 hours time) ... etc;

View solution in original post

0 Karma

nabeel652
Builder

Really hard to explain without the relevant data. However:

All your queries can be written using "transaction" command. https://docs.splunk.com/Documentation/Splunk/6.5.1/SearchReference/Transaction

  • You are looking at bundling your results using transaction command by EmployeeID. Transaction command gives you the duration automatically. Something like this index = Swipe_index | transaction EmployID maxevents=-1 maxspan=-1 startswith = "SwipeIn" keeporphans=true | where duration > 540 (for 9 hours time) ... etc;
0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Announcing Modern Navigation: A New Era of Splunk User Experience

We are excited to introduce the Modern Navigation feature in the Splunk Platform, available to both cloud and ...

Modernize your Splunk Apps – Introducing Python 3.13 in Splunk

We are excited to announce that the upcoming releases of Splunk Enterprise 10.2.x and Splunk Cloud Platform ...

Step into “Hunt the Insider: An Splunk ES Premier Mystery” to catch a cybercriminal ...

After a whole week of being on call, you fell asleep on your keyboard, and you hit a sequence of buttons that ...