All Apps and Add-ons

How can I fetch the latest values?

smanojkumar
Contributor

Hi There,

   Im having several fields and multiple values for same src_name  and email,   I need latest date in check_date and its associated values for that respective src_name, these things are there in lookup, so I need those data of latest in check_date for that specific src_name,

Labels (1)
0 Karma

richgalloway
SplunkTrust
SplunkTrust

Perhaps this will help.

<<your current search for events>>
| eventstats latest(check_date) as max_check_date by src_name
| where check_date=max_check_date
| fields - max_check_date
---
If this reply helps you, Karma would be appreciated.
0 Karma

smanojkumar
Contributor

Hi @richgalloway !

   Thanks for your resposne,

   The field max_check_date is not working as expected, it is not calculating the values, Here the samples of check_date

smanojkumar_0-1682929600557.png


Thanks in Advance!

0 Karma

richgalloway
SplunkTrust
SplunkTrust

Thanks for that information.  This query may work better.  It converts check_date into an integer before computing the max value.

<<your current search for events>>
| eval i_check_date = strptime(check_date, "%d/%m/%Y")
| eventstats latest(i_check_date) as max_check_date by src_name
| where i_check_date=max_check_date
| fields - max_check_date i_check_date
---
If this reply helps you, Karma would be appreciated.
0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

[Puzzles] Solve, Learn, Repeat: Matching cron expressions

This puzzle (first published here) is based on matching timestamps to cron expressions.All the timestamps ...

Design, Compete, Win: Submit Your Best Splunk Dashboards for a .conf26 Pass

Hello Splunkers,  We’re excited to kick off a Splunk Dashboard contest! We know that dashboards are a primary ...

May 2026 Splunk Expert Sessions: Security & Observability

Level Up Your Operations: May 2026 Splunk Expert Sessions Whether you are refining your security posture or ...