Splunk Search

How to pick latest updated file from today

PC00128849
New Member

I have a file, which will be updated multiple times in a single day and the it will be indexed into splunk multiples times in a day, but i want to display the very latest/recently updated file.

how do i do that?

Tags (1)
0 Karma

maciep
Champion

not sure if i understand exactly what you're asking...but given a sourcetype, this will run a subsearch to find the source with the latest timestamped event and use that source to limit your main search.

index=your_index sourcetype=your_sourcetype [|tstats latest(source) as source where index=your_index AND sourcetype=your_sourcetype | table source]
0 Karma
Get Updates on the Splunk Community!

Upcoming Webinar: Unmasking Insider Threats with Slunk Enterprise Security’s UEBA

Join us on Wed, Dec 10. at 10AM PST / 1PM EST for a live webinar and demo with Splunk experts! Discover how ...

.conf25 technical session recap of Observability for Gen AI: Monitoring LLM ...

If you’re unfamiliar, .conf is Splunk’s premier event where the Splunk community, customers, partners, and ...

A Season of Skills: New Splunk Courses to Light Up Your Learning Journey

There’s something special about this time of year—maybe it’s the glow of the holidays, maybe it’s the ...