From eb3a284d551a1d7259834fe6ca9d9390c545dcff Mon Sep 17 00:00:00 2001 From: varac Date: Tue, 21 Feb 2017 11:46:56 +0100 Subject: Use schell script for anonymizing logs --- clean-log.sh | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100755 clean-log.sh (limited to 'clean-log.sh') diff --git a/clean-log.sh b/clean-log.sh new file mode 100755 index 0000000..17ca209 --- /dev/null +++ b/clean-log.sh @@ -0,0 +1,26 @@ +#!/bin/sh + +# Use this sed script to clean your logs before +# pasting it publicly + +# Usage: +# Replace `your_username` and `your_domain` in this script, then: +# +# ./clean-log.sh LOGFILE + +# Todo: +# - IPs (should be already cleaned by rsyslog) +# - Browser user agents +# - Generate this script from leap_cli + + +sed -r ' +# Clean all email addresses +s/((\w|[.])+)@((\w|[.])+)//g + +# Replace username +s/your_username//g + +#Replace domain +s/your_domain//g +' "$1" -- cgit v1.2.3