Getting Data In

How to automate the deletion of some data in a CSV file before indexing?

spin691t
New Member

Hello

Every day at 10:00 am, I receive a .csv file with data from 00:00 of the previous day until 10:00 of the current day (34 hours).

I would like to index only the data of the previous day. Currently I open each file, remove data from 00:00 to 10:00 of the current date, save in an index directory and index in Splunk. Do I have to write a script or set a configuration file for an automatic operation?

Thank you in advance.

Tags (3)
0 Karma

somesoni2
Revered Legend

I would write a script to truncate the file and drop it to Splunk monitored folder OR to just configure that script as Scripted input and make script to send data to Splunk directly (no file monitoring required).

spin691t
New Member

Thank you for your answer. What language Is better to write script phyton or perl or ..?

0 Karma

slashnburn
Path Finder

I would recommend Python. From there you can create a scripted input that performs the operation at a specific time.

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 ...