Getting Data In

If a text file indexed in Splunk is completely replaced every 15 minutes, how to delete the old data from the index without restarting Splunk?

jumah35
New Member

Hi,

I'am working with a text file indexed in Splunk.
Every 15 minutes this file is completely replaced. At this moment, I would like to flush the previous data in the according "index" without restarting splunk process (splunk clean).

Any ideas ?

Regards,

Julien

0 Karma

gkanapathy
Splunk Employee
Splunk Employee

I would say that you're doing something wrong if you're indexing data in Splunk and then deleting it 15 minutes later. Splunk indexes are not intended to hold mutable data, and it's pretty bad at it. (The delete command for example is really only for exceptional cases and doesn't actually remove data from disk.) If you need something that is always, you could consider using lookup files, or (when version 6.2 comes out). These are intended to supplement Splunk use cases with a mutable store. However, if this is your primary data, then Splunk may not be the right solution for this.

jumah35
New Member

Thank you guys for your replies...
I am currently out of office. I will check in a week and keep you posted.
Regards
Julien

0 Karma

christopher_hod
Path Finder

Is it possible you could be using a lookup instead? This way it's never actually indexed (so never needs to be deleted).

Also, if it doesn't really need to be gone and you just want to see the latest version in searches, look at dedup

aljohnson_splun
Splunk Employee
Splunk Employee

Try using delete.

Although deleting does not actually delete the files themselves (does not reclaim disk space), you'll see that using results_you_dont_want | delete does delete the results from the index.

Relevant documentation:
http://docs.splunk.com/Documentation/Splunk/6.1.4/Indexer/RemovedatafromSplunk
http://docs.splunk.com/Documentation/Splunk/6.1.4/SearchReference/Delete

0 Karma

aljohnson_splun
Splunk Employee
Splunk Employee
0 Karma

aljohnson_splun
Splunk Employee
Splunk Employee
0 Karma
Get Updates on the Splunk Community!

Introducing Splunk Enterprise 9.2

WATCH HERE! Watch this Tech Talk to learn about the latest features and enhancements shipped in the new Splunk ...

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

Routing logs with Splunk OTel Collector for Kubernetes

The Splunk Distribution of the OpenTelemetry (OTel) Collector is a product that provides a way to ingest ...