Splunk Search

Compare stats of current day with previous day

aqudoos
Explorer

Hi all!
I am currently getting stats of current day as followed
Port Count
25 25
443 75
53 990

I wanted a table like this

Port Count(Previous Day) Count(Current Day)
25 25 30
443 75 40
53 990 50

My query is like this

Index=* | stats count by port

Please confirm is it possible
Please help!

0 Karma

YoungDaniel
Path Finder

Hi,
Have you tried to use the | appendcols function? or Just append ?


Your search here 
| appendcols [ | search your search here earliest=-2d latest=-1d 
| stats count as yesterday by Port ]
| stats count as today, sum(yesterday) as yesterday by Port


OR

Your search
| eval date="newer"
| append  [ | search <your search> " earliest=-2d latest=-1d 
    |  eval date="older" 
    |  stats count by Port date ]
| stats count by Port date
0 Karma
Get Updates on the Splunk Community!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...