Anonymizes the search results by replacing identifying data - usernames, ip addresses, domain names, and so forth - with fictional values that maintain the same word length. For example, it might turn the string
email@example.com. This lets Splunk users share log data without revealing confidential or personal information.
See the Usage section for more information.
scrub [public-terms=<filename>] [private-terms=<filename>] [name-terms=<filename>] [dictionary=<filename>] [timeconfig=<filename>] [namespace=<string>]
- Syntax: public-terms=<filename>
- Description: Specify a filename that includes the public terms NOT to anonymize.
- Syntax: private-terms=<filename>
- Description: Specify a filename that includes the private terms to anonymize.
- Syntax: name-terms=<filename>
- Description: Specify a filename that includes the names to anonymize.
- Syntax: dictionary=<filename>
- Description: Specify a filename that includes a dictionary of terms NOT to anonymize, unless those terms are in the
- Syntax: timeconfig=<filename>
- Description: Specify a filename that includes the time configurations to anonymize.
- Syntax: namespace=<string>
- Description: Specify an application that contains the alternative files to use for anonymizing, instead of using the built-in anonymizing files.
By default, the
scrub command uses the dictionary and configuration files that are located in the
$SPLUNK_HOME/etc/anonymizer directory. These default files can be overridden by specifying arguments to the
scrub command. The arguments exactly correspond to the settings in the
splunk anonymize CLI command. For details, issue the
splunk help anonymize command.
You can add your own versions of the configuration files to the default location.
Alternatively, you can specify an application where you maintain your own copy of the dictionary and configuration files. To specify the application, use the
namespace=<string> argument, where <string> is the name of the application that corresponds to the name that appears in the path
$SPLUNK_HOME/etc/apps/<app>/anonymizer directory does not exist, the Splunk software looks for the files in the
scrub command anonymizes all attributes, except those that start with underscore ( _ ) except
_raw) or start with
date_. Additionally, the following attributes are not anonymized:
scrub command adheres to the default
maxresultrows limit of 50000 results. This setting is documented in the
limits.conf file in the [searchresults] stanza. See limits.conf in the Admin Manual.
1. Anonymize the current search results using the default files.
... | scrub
2. Anonymize the current search results using the specified private-terms file.
This search uses the
abc_private-terms file that is located in the
... | scrub private-file=abc_private-terms
Have questions? Visit Splunk Answers and see what questions and answers the Splunk community has using the scrub command.
This documentation applies to the following versions of Splunk Cloud™: 6.6.3, 8.0.0, 7.0.11, 7.0.3, 7.0.5, 7.0.0, 7.0.2, 7.1.3, 7.0.8, 7.1.6, 7.2.3, 7.2.4, 7.2.6, 7.2.7, 7.2.8, 7.2.9