Splunk Search

Multiple stats command

lkslsaks
Loves-to-Learn

 

bin _time span=1h | stats count(eval(eventDay==curDay)) AS cv by uid | stats count(eval(eventDay!=curDay)) AS ce by _time, uid 

 

The following commands returns with null value in  "cv"  @Lowell @Hazel  @ramdaspr @ITWhisperer

Labels (3)
0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

Is this what you are trying to do - if not, please explain what you are attempting to do (not just what doesn't work)

bin _time span=1h | stats count(eval(eventDay==curDay)) AS cv count(eval(eventDay!=curDay)) AS ce by _time, uid 
0 Karma

kamlesh_vaghela
SplunkTrust
SplunkTrust

@lkslsaks 

Your second stats will not work. Because after 1st stats there will be only cv and uid fields available in results.

bin _time span=1h | stats count(eval(eventDay==curDay)) AS cv by uid 

 

The second stats required  eventDay,curDay,_time and uid. That's Y you are not getting any results.

| stats count(eval(eventDay!=curDay)) AS ce by _time, uid

 

Please share the logic or steps for your search. So we can help you on.

KV

0 Karma
Get Updates on the Splunk Community!

Introducing the Splunk Community Dashboard Challenge!

Welcome to Splunk Community Dashboard Challenge! This is your chance to showcase your skills in creating ...

Built-in Service Level Objectives Management to Bridge the Gap Between Service & ...

Wednesday, May 29, 2024  |  11AM PST / 2PM ESTRegister now and join us to learn more about how you can ...

Get Your Exclusive Splunk Certified Cybersecurity Defense Engineer Certification at ...

We’re excited to announce a new Splunk certification exam being released at .conf24! If you’re headed to Vegas ...