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!

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

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, ...