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!

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...