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
Get Updates on the Splunk Community!

Introducing the Splunk Community Dashboard Challenge!

Welcome to Splunk Community Dashboard Challenge! This is your chance to showcase your skills in creating ...

Built-in Service Level Objectives Management to Bridge the Gap Between Service & ...

Wednesday, May 29, 2024  |  11AM PST / 2PM ESTRegister now and join us to learn more about how you can ...

Get Your Exclusive Splunk Certified Cybersecurity Defense Engineer Certification at ...

We’re excited to announce a new Splunk certification exam being released at .conf24! If you’re headed to Vegas ...