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
SplunkTrust
SplunkTrust

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
SplunkTrust
SplunkTrust

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!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...