Splunk Search

How can I see the difference in a count for two different types of events by day?

Esperteyu
Explorer

Hi,

I would like to see the difference in a count for two different type of events per day. Currently I have it in total but not sure how to split it per day

index="index1" ("first string" OR "second string") | eval First=if(searchmatch("first string"),1,0) | eval Second=if(searchmatch("second string"),1,0) | stats sum(First) as FirstChecks sum(Second) as SecopndChecks | eval missing=FirstChecks - SecondChecks

Thanks

0 Karma
1 Solution

DalJeanis
Legend

try this

index="index1" ("first string" OR "second string") 
| bin _time span=1d
| eval First=if(searchmatch("first string"),1,0) 
| eval Second=if(searchmatch("second string"),1,0) 
| stats sum(First) as FirstChecks sum(Second) as SecondChecks by _time 
| eval missing= FirstChecks - SecondChecks

View solution in original post

0 Karma

DalJeanis
Legend

try this

index="index1" ("first string" OR "second string") 
| bin _time span=1d
| eval First=if(searchmatch("first string"),1,0) 
| eval Second=if(searchmatch("second string"),1,0) 
| stats sum(First) as FirstChecks sum(Second) as SecondChecks by _time 
| eval missing= FirstChecks - SecondChecks
0 Karma
Get Updates on the Splunk Community!

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...

Introducing Splunk Enterprise 9.2

WATCH HERE! Watch this Tech Talk to learn about the latest features and enhancements shipped in the new Splunk ...

Adoption of RUM and APM at Splunk

    Unleash the power of Splunk Observability   Watch Now In this can't miss Tech Talk! The Splunk Growth ...