splunk clean eventdata -index <indexname>See Remove indexed data from Splunk (RemovedatafromSplunk) for more detail.
index=main sourcetype=<mydata> latest=-1y | deleteSee Delete command (Delete) for more detail.
First, you may use dbinspect to identify the indexer hosts and the corresponding bucket paths containing the event data, you can execute the following sample query:
| dbinspect index=logs splunk_server=indexer
1. After identifying the buckets, locate the paths for the hot/warm/cold buckets for that particular index.
For example:
$ ls -l /d/d1/splunk/prod/index_name/10/db/logs/db total 124 -rw-r--r-- 1 psplunk cc2283 10 Aug 2 21:02 CreationTime drwxr-xr-x 2 psplunk cc2283 4096 Aug 2 21:02 GlobalMetaData drwxr-xr-x 3 psplunk cc2283 20480 Dec 11 12:48 db_1701824008_1701388768_76 -rw-r--r-- 1 psplunk cc2283 0 Dec 11 12:48 db_1701824008_1701388768_76.rbsentinel drwxr-xr-x 3 psplunk cc2283 4096 Dec 12 14:29 hot_v1_82 drwxr-xr-x 3 psplunk cc2283 4096 Dec 12 14:29 hot_v1_83$ ls -l /d/d1/splunk/prod/index_name/10/db/logs/colddb total 292 drwxr-xr-x 3 psplunk cc2283 4096 Nov 12 01:42 db_1699830546_1699795309_59 -rw-r--r-- 1 psplunk cc2283 0 Dec 7 15:15 db_1700309006_1699860554_63.rbsentinel
In this example, you would manually delete the desired directories:
/d/d1/splunk/prod/index_name/10/db/logs/db /d/d1/splunk/prod/index_name/10/db/logs/colddb
This will performantly remove them from disk immediately and upon running the search for these events, the data will not be found as expected, within Splunk UI.
2. The other recommendation is to execute the same search and delete command within the command line versus doing it in the GUI (if you encounter any problem on the web interface).
You may reference this Splunk doc when looking for search and delete syntax to be use via CLI
IF there are many buckets where data needs to be purged from disk, you may want to write a recursive SED command to iterative run the removal on the affected indexers to get rid of the bucket data more seamlessly.
The ramification is that you will likely delete all data in those same bucket as the intended data you wish to remove from the "| delete" command, since it would be deleted directly from disk, it's everything in that bucket vs having the specific events searched for in the Splunk store.
[default] frozenTimePeriodInSecs = 31536000
[default] maxTotalDataSizeMB = 500000
Set a retirement and archiving policy
search and delete syntax to be use via CLI
| Revision | Publish Date | Comments |
|---|---|---|
1.0 |
30-Sep-2026
|
Initial Release |