Splunk Search

What is the best approach for calculating a count and showing the most recent occurrence timestamp?

mumblingsages
Path Finder

Given data like:

_time, lastname

How would I do a count of lastname and display the most recent _time for that lastname on the same row of a results table?

--Mark

Tags (2)
0 Karma

woodcock
Esteemed Legend

Like this:

index=YouShouldAlwaysSpecifyAnIndex AND sourcetype=AndSourcetypeToo
| stats count max(_time) latest(_raw) BY lastname
0 Karma

renjith_nair
Legend

@mumblingsages ,

Try,

"your base search" |stats count , latest(_time) by lastname
Happy Splunking!
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 ...