Splunk Search

Search latest indexed file for different sourcetype

meenal901
Communicator

Hi,

I have 3 sources from which the files are loaded into Splunk, the time of arrival of files and frequency is different for all three.
source-1 -> every 5 minutes
source-2 -> every 1 hour
source-3 -> every 4 hours

Now, these files go into same folder based on version, which is a common field for all three, not the version. I want to search in the latest files (time based in their own family) of source-1, source-2 and source-3 irrespective of their comparative index time. I don't want to use transaction command.

Is it possible? If so, how?

Thanks,
Meenal

Tags (1)
0 Karma

kristian_kolb
Ultra Champion

If all your sources are on NTP or similar, so that you can trust the event timestamps, something like this perhaps?

(source=source_1 AND earliest=-5m) OR (source=source_2 AND earliest=-1h) OR (source=source_3 AND earliest=-4h) | the rest of your search

/Kristian

0 Karma
Get Updates on the Splunk Community!

Threat Hunting Unlocked: How to Uplevel Your Threat Hunting With the PEAK Framework ...

WATCH NOWAs AI starts tackling low level alerts, it's more critical than ever to uplevel your threat hunting ...

Splunk APM: New Product Features + Community Office Hours Recap!

Howdy Splunk Community! Over the past few months, we’ve had a lot going on in the world of Splunk Application ...

Index This | Forward, I’m heavy; backward, I’m not. What am I?

April 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...