Splunk Search

Join two statistics tables without subsearch

sbarinov
Path Finder

Hi,

 

I am trying to compare event type count statistics for 2 days using the following search:

earliest=-48h latest=-24h | stats count as count1 by eventtype | table eventtype, count1 | join eventtype [search earliest=-24h latest=now() | stats count as count2 by eventtype | table eventtype, count2] | eval diff=(count2-count1)  | table eventtype, diff | sort diff

Is there any option to do this without using subsearch and join?

 

Thanks.

Labels (4)
0 Karma
1 Solution

ITWhisperer
SplunkTrust
SplunkTrust
earliest=-48h latest=now()
| eval period=floor((now()-_time)/(24*60*60))
| stats count(eval(period=1)) as count1 count(eval(period=0)) as count2 by eventtype
| eval diff=count2-count1
| table eventtype diff
| sort diff

View solution in original post

ITWhisperer
SplunkTrust
SplunkTrust
earliest=-48h latest=now()
| eval period=floor((now()-_time)/(24*60*60))
| stats count(eval(period=1)) as count1 count(eval(period=0)) as count2 by eventtype
| eval diff=count2-count1
| table eventtype diff
| sort diff

sbarinov
Path Finder

@ITWhisperer  Thank you!

0 Karma
Get Updates on the Splunk Community!

Webinar Recap | Revolutionizing IT Operations: The Transformative Power of AI and ML ...

The Transformative Power of AI and ML in Enhancing Observability   In the realm of IT operations, the ...

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...