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!

Splunk Observability Cloud | Customer Survey!

If you use Splunk Observability Cloud, we invite you to share your valuable insights with us through a brief ...

.conf23 | Get Your Cybersecurity Defense Analyst Certification in Vegas

We’re excited to announce a new Splunk certification exam being released at .conf23! If you’re going to Las ...

Starting With Observability: OpenTelemetry Best Practices

Tech Talk Starting With Observability: OpenTelemetry Best Practices Tuesday, October 17, 2023   |  11AM PST / ...