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!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...