Admin Manual

 


How Splunk Works

Remove (delete) data

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

Remove (delete) data

With Splunk's tools, you can remove:


Note: You must have admin level privileges to remove data.


You have two main options when removing data from Splunk:


Caution: Removing data is irreversible. Use caution when choosing what events to remove from searches, or what data to remove from your Splunk installation. If you want to get your data back, you must re-index the applicable data source(s).


The CLI command: clean

The clean CLI command deletes event data, global data, and user account data from your Splunk installation. clean takes the following arguments: eventdata, globaldata, userdata, and all.


Add the -f parameter to force clean to skip its confirmation prompts.


Note: Type ./splunk help clean to access the help page for clean while in the CLI.


Remove event data from an index

Permanently remove event data from an index on your Splunk installation by typing ./splunk clean followed by the eventdata argument. Specify an index to delete event data from a specific index. If you don't specify an index, Splunk deletes all event data from all indexes.


Examples:


This example tells Splunk to remove event data in all indexes (because no index argument is specified).


./splunk clean eventdata 

This example removes indexed event data from the internal index and forces Splunk to skip the confirmation prompt.


./splunk clean eventdata internal -f

Remove global data

Remove global data (tags and source type aliases for events you've indexed) from your Splunk installation by typing ./splunk clean followed by the globaldata argument.


Examples:


This example removes the global data for all indexed events.


./splunk clean globaldata

This example removes the global data for all indexed events and forces Splunk to skip the confirmation prompt.


./splunk clean globaldata -f

Remove user data

Remove user data (user accounts you've created) from your Splunk installation by typing ./splunk clean followed by the userdata argument.


Examples:


This example removes all of the user accounts you've created.


./splunk clean userdata

This example removes the user accounts you've created and forces Splunk to skip the confirmation prompt.


./splunk clean userdata -f

Remove all data

Remove all global, user, and indexed event data to return Splunk to its original installation state by typing ./splunk clean followed by the all argument.


Examples:


This example removes all global, user, and indexed event data.


./splunk clean all

This example removes all global, user, and indexed event data you've created and forces Splunk to skip the confirmation prompt.


./splunk clean all -f

Remove events from search results

Use the delete:: modifier to remove events from search results based on an indexed field value, or matching a string. Access the delete:: modifier by piping any search to the oldsearch command.


The delete:: modifier doesn't delete events from the index; it masks events from being displayed in search results by tagging them with a value in the index that makes them unsearchable.


Caution: Removing data is irreversible. Use caution when choosing what events to remove from searches, or what data to remove from your Splunk installation. If you want to get your data back, you must re-index the applicable data source(s).


Note: oldsearch is the deprecated version of the search command.


Syntax

search | oldsearch delete::(host | source | sourcetype)::value


Examples:


This example searches for "foo" and removes events of sourcetype=bar from the search results.


foo | oldsearch delete::sourcetype::bar

This example searches for "foo" and removes events from the host "webserver1".


foo | oldsearch delete::host::websever1

This documentation applies to the following versions of Splunk: 3.2 , 3.2.1 , 3.2.2 , 3.2.3 , 3.2.4 , 3.2.5 , 3.2.6 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!