Splunk Search

How to make Linechart of users logged in throughout the day with tstats?

powermundsen
Engager

I want to make a linechart of users in a division logged in throughout the day, but I can't make the tstat search work with linechart. The count works fine but I want to group the users by 30 minutes.

A typical users are:
COMPANY\HR94832
COMPANY\AC49328

So I have to filter the user with "COMPANY\HR*.
| tstats summariesonly=true allow_old_summaries=true
dc(Session_SessionDetail.SessionUser) as Users
from datamodel=uberAgent.Session_SessionDetail
where Session_SessionDetail.SessionUser = "COMPANY\HR*" by _time

alt text

0 Karma
1 Solution

somesoni2
SplunkTrust
SplunkTrust

You just need to add span in your tstats command, like this

| tstats summariesonly=true allow_old_summaries=true
dc(Session_SessionDetail.SessionUser) as Users
from datamodel=uberAgent.Session_SessionDetail 
where Session_SessionDetail.SessionUser = "COMPANY\\HR*" by _time span=30m

See this for more information on this option
http://docs.splunk.com/Documentation/Splunk/7.1.1/SearchReference/Tstats#BY_clause_arguments

View solution in original post

somesoni2
SplunkTrust
SplunkTrust

You just need to add span in your tstats command, like this

| tstats summariesonly=true allow_old_summaries=true
dc(Session_SessionDetail.SessionUser) as Users
from datamodel=uberAgent.Session_SessionDetail 
where Session_SessionDetail.SessionUser = "COMPANY\\HR*" by _time span=30m

See this for more information on this option
http://docs.splunk.com/Documentation/Splunk/7.1.1/SearchReference/Tstats#BY_clause_arguments

renjith_nair
SplunkTrust
SplunkTrust

Hi @powermundsen,

What about adding |bin span=30m _time|stats sum(count) by _time,sourcetype to end of your search

Happy Splunking!
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...