Getting Data In

listing the starting and ending time for a field value

smolcj
Builder

hi,
my log contains several users and i have to create a text report or a table listing the starting and ending time of the activities of the user, it will be in sequential manner(there will be continuous activities from one user and once he goes idle the other user will start ans so on).it means when the user "started" his activities and when he "logged out". i will not get a logged out or similar message in my logs so that i can filter through it. But how to list the time according to the field value i mean "users".
Thanks for your valuable time.

Tags (1)
0 Karma

Ayn
Legend

Assuming you have a field called "user" in your events that identifies which user the event is referring to:

... | stats earliest(_time),latest(_time) by user
0 Karma

smolcj
Builder

Thanks Ayn, it really worked. shall i ask one more doubt? if my user is logging out and later he is logging in again, then i will get the second logout time as the logout time. how can i include both the sesssion? is there any query which helps it?
THANK YOU

0 Karma
Get Updates on the Splunk Community!

Get the T-shirt to Prove You Survived Splunk University Bootcamp

As if Splunk University, in Las Vegas, in-person, with three days of bootcamps and labs weren’t enough, now ...

Introducing the Splunk Community Dashboard Challenge!

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

Wondering How to Build Resiliency in the Cloud?

IT leaders are choosing Splunk Cloud as an ideal cloud transformation platform to drive business resilience,  ...