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
---
What goes around comes around. If it helps, hit it with Karma 🙂
0 Karma
Get Updates on the Splunk Community!

Automatic Discovery Part 1: What is Automatic Discovery in Splunk Observability Cloud ...

If you’ve ever deployed a new database cluster, spun up a caching layer, or added a load balancer, you know it ...

Real-Time Fraud Detection: How Splunk Dashboards Protect Financial Institutions

Financial fraud isn't slowing down. If anything, it's getting more sophisticated. Account takeovers, credit ...

Splunk + ThousandEyes: Correlate frontend, app, and network data to troubleshoot ...

 Are you tired of troubleshooting delays caused by siloed frontend, application, and network data? We've got a ...