Getting Data In

How can I grab the latest source from a csv file, ranging from the earliest to anything within 5 minutes of that time?

chadman
Path Finder

I have splunk import a csv file every time it's changed. Splunk imports each line of the csv file as an event. I have tried to do a search by the latest time and that works, but sometimes it takes couple seconds for splunk to import the file and it will have multiple time stamps across all the events for that one import. Any way to grab the latest source from the earliest to anything with 5 min of that time?

0 Karma

somesoni2
SplunkTrust
SplunkTrust

Try like this

index=foo sourcetype=bar source=*yourfile.csv  [| tstats max(_time) as latest WHERE index=foo sourcetype=bar source=*yourfile.csv |eval latest=latest+1 |  eval earliest=relative_time(lateset,"-5m") | table earliest latest ]
0 Karma
Get Updates on the Splunk Community!

Welcome to the Splunk Community!

(view in My Videos) We're so glad you're here! The Splunk Community is place to connect, learn, give back, and ...

Tech Talk | Elevating Digital Service Excellence: The Synergy of Splunk RUM & APM

Elevating Digital Service Excellence: The Synergy of Real User Monitoring and Application Performance ...

Adoption of RUM and APM at Splunk

    Unleash the power of Splunk Observability   Watch Now In this can't miss Tech Talk! The Splunk Growth ...