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!

Combine Multiline Logs into a Single Event with SOCK - a Guide for Advanced Users

This article is the continuation of the “Combine multiline logs into a single event with SOCK - a step-by-step ...

Everything Community at .conf24!

You may have seen mention of the .conf Community Zone 'round these parts and found yourself wondering what ...

Index This | I’m short for "configuration file.” What am I?

May 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with a Special ...