Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • Options
    • -l | --log-file=<log-file>: Specifies the location of a log file to be anonymized.
      • This option can be specified repeatedly for a number of files. Wildcards can be specified and directories can be specified should all included files be anonymized.
      • Plain text log files as available with the .log file extension are considered and compressed log files available with the .gz file extension, see the JS7 - Log Rotation article.
      • Anonymized log file names are prefixed with the string: anonymized- 
      • By default anonymized log files are stored to the directory in which original log files are found.
    • -o | --output-dir=<directory>: Optionally specifies the output directory to which anonymized log files are stored. If this argument is omitted then anonymized log files are stored to their original directory.
    • -r | --rules-file=<rules-file>: Optionally specifies the location of a file in YAML format that holds the expressions that should rules to be applied for anonymization.
    • -e | --export-rules=<rules-file>: Optionally specifies the location of a file to which default expressions the built-in rules for anonymization are exported.

...

  • Creates anonymized versions of the indicated log files in the given output directory:
    • /tmp/logs/anonymized-joc.log
    • /tmp/logs/anonymized-joc-debug.log

...

  • Creates anonymized versions of the indicated log files from the given directory. The wildcard specifies any log files carrying a name that starts with joc to be used.
  • The wildcard includes to specify consider plain text log files available from the .log file extension and it includes to specify consider compressed log files that are available from a .gz file extension.
  • Anonymized log files are stored in the output directory.

...

  • The build-in rules are exported to a file in YAML format.
  • This file can be used to adjust rules and can be applied for anonymization later on.


Code Block
titleExample for Invocation of Log Anonymizer Script with individual Rules from a File
log-anonymizer.sh --log-file=/var/sos-berlin.com/js7/agent/var_4445/logs/*.log \
                  --output-dir=/tmp/logs \
                  --rules-file=/tmp/rules.yaml

...