Splunk Search

Give me a count of all events but give me the date of the last event?

the_wolverine
Champion

I'm generating a table of event count (same events) but I want it to also return the timestamp of the last event. I can't figure out how to do it. Running stats count against timestamp will give me a single count for each timestamp.

timestamp,color,shape,count
?,blue,square,5
?,red,circle,15
?,yellow,triangle,12

Help?

0 Karma
1 Solution

Ayn
Legend
... | stats count, latest(_time)

?

View solution in original post

Ayn
Legend
... | stats count, latest(_time)

?

the_wolverine
Champion

Thank you, Ayn!!!!!

0 Karma

Ayn
Legend

Well then, stats count, latest(_time) by color,shape

the_wolverine
Champion

I think I oversimplified my example. I have a few fields in there so there are a couple of eventtypes, actually.

0 Karma
Get Updates on the Splunk Community!

Routing logs with Splunk OTel Collector for Kubernetes

The Splunk Distribution of the OpenTelemetry (OTel) Collector is a product that provides a way to ingest ...

Welcome to the Splunk Community!

(view in My Videos) We're so glad you're here! The Splunk Community is place to connect, learn, give back, and ...

Tech Talk | Elevating Digital Service Excellence: The Synergy of Splunk RUM & APM

Elevating Digital Service Excellence: The Synergy of Real User Monitoring and Application Performance ...