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!

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...

New in Observability Cloud - Explicit Bucket Histograms

Splunk introduces native support for histograms as a metric data type within Observability Cloud with Explicit ...