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
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.
Get Updates on the Splunk Community!

Data Persistence in the OpenTelemetry Collector

This blog post is part of an ongoing series on OpenTelemetry. What happens if the OpenTelemetry collector ...

Introducing Splunk 10.0: Smarter, Faster, and More Powerful Than Ever

Now On Demand Whether you're managing complex deployments or looking to future-proof your data ...

Community Content Calendar, September edition

Welcome to another insightful post from our Community Content Calendar! We're thrilled to continue bringing ...