Getting Data In

how to calculate and get the statistical table for today vs yesterday vs last7days volume

selvam_sekar
Path Finder
 
Labels (1)
Tags (1)
0 Karma
1 Solution

gcusello
SplunkTrust
SplunkTrust
0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @selvam_sekar,

did you explored the timewrap command at https://docs.splunk.com/Documentation/Splunk/9.2.0/SearchReference/Timewrap ?

Ciao.

Giuseppe

0 Karma

selvam_sekar
Path Finder

thanks @gcusello . Could you help me with below asks?

when we run the base query without timewrap, the todays count is only 6 and yesterday count us 19.

But, when we run the base query with timewrap the todays total is 25 and yesterday total is 13. 

Splunk Query:

basesearch earliest=-7d@d latest=now()
| timechart span=1h count
| timewrap d series=short
| addtotals s*
| eval 7dayavg=Total/7.0
| table _time, s0, s1, Total, 7dayavg
| rename s0 as Today, s1 as yesterday

Results:

_time Today yesterday Total 7dayavg

2024-01-31 08:000000.0
2024-01-31 09:000000.0
2024-01-31 10:002040.57
0 Karma
Get Updates on the Splunk Community!

Enter the Splunk Community Dashboard Challenge for Your Chance to Win!

The Splunk Community Dashboard Challenge is underway! This is your chance to showcase your skills in creating ...

.conf24 | Session Scheduler is Live!!

.conf24 is happening June 11 - 14 in Las Vegas, and we are thrilled to announce that the conference catalog ...

Introducing the Splunk Community Dashboard Challenge!

Welcome to Splunk Community Dashboard Challenge! This is your chance to showcase your skills in creating ...