Splunk Search

How can I list out values of the top 2 (latest 2)Time stamps

AyanC
New Member

Date1 Host Path1
Date2 Host Path2
Date 3 Host Path3

I need to table out the latest Host, latest 2 dates, and the corresponding 2 paths
Please help!!

Tags (2)
0 Karma

somesoni2
Revered Legend

Try this (assuming Date is in epoch format OR using _time field).

your current search giving fields DateField HostField PathFIeld
| sort 2 -DateField

If Date is not in epoch format (or not using _time), convert to epoch and do sort

your current search giving fields DateField HostField PathFIeld | eval sortfield=strptime(DateField,"<<DateFormatHere>>")
| sort 2 -sortfield
0 Karma
Get Updates on the Splunk Community!

CX Day is Coming!

Customer Experience (CX) Day is on October 7th!! We're so excited to bring back another day full of wonderful ...

Strengthen Your Future: A Look Back at Splunk 10 Innovations and .conf25 Highlights!

The Big One: Splunk 10 is Here!  The moment many of you have been waiting for has arrived! We are thrilled to ...

Now Offering the AI Assistant Usage Dashboard in Cloud Monitoring Console

Today, we’re excited to announce the release of a brand new AI assistant usage dashboard in Cloud Monitoring ...