Skip to content
A script to redact MongoDB log files
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


A script to redact MongoDB log files.

This script reads a MongoDB log file and outputs a redacted version of the log file, replacing IP addresses, namespaces and query/update data. Namespace details are replaced with generic adjectives, colours and fruit names (hence the name "fruitsalad"). IP addresses are mapped to a private range starting with 192.168.. The query values are hashed with a standard MD5 algorithm, so that the distribution of data remains unchanged, while the actual data will be lost. Note: The field names of the queries are currently left unchanged.

This is a very early beta version.


python <logfile>

to output the scrambled version to stdout, or redirect the output to a file by adding > redacted.log to the end of the command.


fruitsalad uses nose for testing. Please follow the instructions in the nose documentation page for the recommended method to install nose. After nose is installed, testing could be done by running:

nosetests -v

in fruitsalad's root directory. The -v is optional, and is only used to display a more verbose testing messages.


This software is not supported by MongoDB, Inc. under any of their commercial support subscriptions or otherwise. Any usage of fruitsalad is at your own risk. Bug reports, feature requests and questions can be posted in the Issues section here on github.

You can’t perform that action at this time.