Dashboards & Visualizations

Active vs Inactive Users in a Timechart

rajkskumar
Explorer

I have a chart that displays the Active and Inactive Users for today. I would like to convert this into a timechart which shows data for the selected Period in the Time picker. 

 

index=prod 
       | stats latest(_time) as last_seen by customerId 
       | eval status = if(last_seen > relative_time(now(), "-30d@d"),"Active","Inactive") 
       | chart count by status
       | rename count as "User Count"

 

Please suggest how it could be approached.

@FrankVl : You have helped me with the original query. Could you please guide me here as well?

Labels (1)
0 Karma

FrankVl
Ultra Champion

One way to do that would be to run the search you have, that gives you today's figures, on a daily basis and write the results into a summary index. Then run a timechart over that summary index. But of course, that does require some time to build up data in the summary index before you're able to timechart anything.

Creating a query that directly gives you a timechart of active and inactive users by day is a bit more tricky as that activity is based on a 30d window.

0 Karma

richgalloway
SplunkTrust
SplunkTrust

Replacing chart with timechart should do it.

---
If this reply helps you, Karma would be appreciated.
0 Karma

rajkskumar
Explorer

Unfortunately, it is not working. I don't get any results with Timechart. With 'Chart', I get the Active and Inactive count for today.

0 Karma
Get Updates on the Splunk Community!

Index This | Why did the turkey cross the road?

November 2025 Edition  Hayyy Splunk Education Enthusiasts and the Eternally Curious!   We’re back with this ...

Enter the Agentic Era with Splunk AI Assistant for SPL 1.4

  🚀 Your data just got a serious AI upgrade — are you ready? Say hello to the Agentic Era with the ...

Feel the Splunk Love: Real Stories from Real Customers

Hello Splunk Community,    What’s the best part of hearing how our customers use Splunk? Easy: the positive ...