All Apps and Add-ons

How can I fetch the latest values?

smanojkumar
Communicator

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
Communicator

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
Get Updates on the Splunk Community!

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

Introducing the 2024 SplunkTrust!

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