Splunk Search

How do I delete previously loaded data before new data is indexed in Splunk?

shivendra_infy
Path Finder

Hi

I am using SQL Source as my Data Source. I have written a Select query which loads data in the Database every 5 minutes. Now, what I need is before the Select query loads data in Splunk, I need to delete the previously loaded data.

0 Karma

puneethgowda
Communicator

I have the same question data is appending but old data and new data will be same some time so i am seeing less than 1,000 rows in MS sql live db and 10,000 rows in splunk which means 1000*10=10,000 but there should be 1,000 rows only as it is in ms sql i mean mirroring !:)

0 Karma

ddrillic
Ultra Champion

You can always run <base query> | delete which would delete the returned data.

0 Karma

martin_mueller
SplunkTrust
SplunkTrust

Have you considered a live db lookup instead of deleting and reindexing the data every few minutes?
If you can't do a live lookup, consider writing the data into the key value store instead of indexing it. There you can delete, update, etc.

For actually indexed data, delete and update aren't valid operations.

Get Updates on the Splunk Community!

More Ways To Control Your Costs With Archived Metrics | Register for Tech Talk

Tuesday, May 14, 2024  |  11AM PT / 2PM ET Register to Attend Join us for this Tech Talk and learn how to ...

.conf24 | Personalize your .conf experience with Learning Paths!

Personalize your .conf24 Experience Learning paths allow you to level up your skill sets and dive deeper ...

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