How can we anonymize user date at search time?
Splunk Enterprise has a few methods to anonymize data in files you send to Support. This lets Splunk Enterprise users share log data without revealing confidential or personal information from their networks.
Diag by default removes some types of sensitive information from search strings in diag files. Read about configuring search string redaction in server.conf.spec.
The anonymize function combs through sample log files or event files to replace identifying data - like usernames, IP addresses, domain names - with fictional values that maintain the same word length and event type. For example, it might turn the string user=carol@adalberto.com into user=plums@wonderful.com.
The anonymized file is written to the same directory as the source file, with ANON- prepended to its filename. For example, /tmp/messages will be anonymized as /tmp/ANON-messages. In Windows, a file \temp\messages becomes \temp\ANON-messages.
Anonymize is controlled from the Splunk Enterprise CLI. See About the CLI for instructions on accessing the Splunk Enterprise CLI.
The easiest way to anonymize a file is with the anonymizer tool's defaults, as shown in the session below.
It is good practice to copy the file somewhere safe (like /tmp or \temp) before performing this command.
Calculating replacements for 4672 terms.
Wrote dictionary scrubbed terms with replacements to "/tmp/INFO-mapping.txt"
Wrote suggestions for dictionary to "/tmp/INFO-suggestions.txt"
Calculating replacements for 44 terms.
Wrote dictionary scrubbed terms with replacements to "c:\temp\INFO-mapping.txt"
Wrote suggestions for dictionary to "c:\temp\INFO-suggestions.txt"
You can customize the anonymizer by telling it what terms to anonymize, what terms to leave alone, and what terms to use as replacements.
Path and name of the file to anonymize.
A list of locally used words that will not be anonymized if they are in the file. It serves as an appendix to the dictionary file.
A list of words that will be anonymized if found in the file, because they may denote confidential information.
A global list of common English personal names that Splunk software uses to replace anonymized words.
Anonymize always replaces a word with a name of the exact same length, to keep each event's data pattern the same.
Anonymize uses each name in name_terms once to replace a character string of equal length throughout the file. After it runs out of names, it begins using randomized character strings, but still mapping each replaced pattern to one anonymized string.
A global list of common words that will not be anonymized, unless overridden by entries in the private_terms file.
File built into Splunk software that determines how timestamps are parsed.
Splunk's anonymizer function will create three new files in the same directory as the source file.
The anonymized version of the source file.
This file contains a list of which terms were anonymized into which strings.
A report of terms found in the file that, based on their appearance and frequency, you may want to add to public_terms.txt or to private-terms.txt or to public-terms.txt for more accurate anonymization of your local data.
Here are the steps to generate a diagnostic (diag file) and then anonymize the logs of that diag.
4. Keep all the files that now have a prefix of ANON*.log while deleting the non-anonymized versions in the diag directory.
6. Upload the diag, adding it to the Support case, with the ADD FILE button in the case.