Splunk Search

How to control time span in tstats search?

koshyk
Super Champion

hi,
I was looking to find more time precise dataset in the last 1 hour

|tstats summariesonly=true count from datamodel=Authentication where earliest=-60m latest=-1m  by _time,Authentication.tag,Authentication.user

This works perfectly, but the _time is automatically bucketed as per the earliest/latest settings. So if I use -60m and -1m, the precision drops to 30secs. If I change it to 24hrs, the precision drops to 30minutes or so. In normal search (like timechart i could use span), but how can we do similar span command in a tstats search?

I could find a question in similar lines, but the answer is not working on the base search which is incorrect.

0 Karma
1 Solution

harshpatel
Contributor

Have you tried?

|tstats summariesonly=true count from datamodel=Authentication by _time,Authentication.tag,Authentication.user span=60m

View solution in original post

harshpatel
Contributor

Have you tried?

|tstats summariesonly=true count from datamodel=Authentication by _time,Authentication.tag,Authentication.user span=60m

koshyk
Super Champion

Thanks for that. I've put span almost at every word except at the end 🙂
This solved the problem. Cheers

0 Karma
Get Updates on the Splunk Community!

Take Your Breath Away with Splunk Risk-Based Alerting (RBA)

WATCH NOW!The Splunk Guide to Risk-Based Alerting is here to empower your SOC like never before. Join Haylee ...

SignalFlow: What? Why? How?

What is SignalFlow? Splunk Observability Cloud’s analytics engine, SignalFlow, opens up a world of in-depth ...

Federated Search for Amazon S3 | Key Use Cases to Streamline Compliance Workflows

Modern business operations are supported by data compliance. As regulations evolve, organizations must ...