Admin Manual

 


How Splunk Works

Delete data from the index

This documentation does not apply to the most recent version of Splunk. Click here for the latest version.

Delete data from the index

You can run delete commands from the Splunk CLI. To use Splunk's CLI, navigate to the $SPLUNK_HOME/bin/ directory and type ./splunk followed by a Splunk CLI command. You can also add Splunk to your path and use the command line.


Delete everything

Run this command on the Splunk server host to delete all indexed data, users, and other Splunk-related data on the server:


# splunk clean all

Run this command to delete event data:


# splunk clean eventdata

Delete a subset of events

Use the delete= command either in the search bar of SplunkWeb, or from the command line on the Splunk server host:


delete=<search-terms>

Note: there are a few restrictions to the delete= command:


For example:


splunk search "daysago=1 delete=host::10.1.1.72 deleterestrict=source::/var/log/anaconda.log"

This command will delete every event with host::10.1.1.72 from source::/var/log/anaconda.log whose timestamp is within the past day.


If you type delete= into the web interface, you'll see a typeahead list of all allowable completions for a delete= command on your data. The same is true for deleterestrict=.


The best way to use delete= is:


Note:


This documentation applies to the following versions of Splunk: 3.0 , 3.0.1 , 3.0.2 , 3.1 , 3.1.1 , 3.1.2 , 3.1.3 , 3.1.4 View the Article History for its revisions.


You must be logged into splunk.com in order to post comments. Log in now.

Was this documentation topic helpful?

If you'd like to hear back from us, please provide your email address:

We'd love to hear what you think about this topic or the documentation as a whole. Feedback you enter here will be delivered to the documentation team.

Feedback submitted, thanks!