Add dashboard template
[scripts.git] / clean-log.sh
1 #!/bin/sh
2
3 # Use this sed script to clean your logs before
4 # pasting it publicly
5
6 # Usage:
7 #   Replace `your_username` and `your_domain` in this script, then:
8 #
9 #     ./clean-log.sh LOGFILE
10
11 # Todo:
12 #  - IPs (should be already cleaned by rsyslog)
13 #  - Browser user agents
14 #  - Generate this script from leap_cli
15
16 sed -r '
17 # Clean all email addresses
18 s/((\w|[.])+)@((\w|[.])+)/<EMAIL REDACTED>/g
19
20 # Replace username
21 s/your_username/<USERNAME_REDACTED>/g
22
23 #Replace domain
24 s/your_domain/<DOMAIN_REDACTED>/g
25 ' "$1"