Versions Compared

Key

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

Table of Contents

Introduction

Display feature availability
StartingFromRelease2.4.0

Log files include data which is considered sensitive by a number of users. This includes:

...

  • Creates anonymized versions of all log files in the indicated directory and stores them in the output directory.
  • A YAML file with individual rules is applied.

Running Log Anonymizer outside of JS7

Users who wish to run the Log Anonymizer outside of a JS7 installation can

  • copy a number of binary files as available from the Controller or Agent installation,
  • create a shell script to invoke Log Anonymizer.

Java Binary Files required by Log Anonymizer

The following binary files can be found from a Controller or Agent installation for Unix or Windows.

  • Note that version numbers of binary files can change over time. The below examples assume binary files as provided with Release 2.4.0.
  • Users can copy the following binary files from the ./lib/3rd-party and ./lib/sos directories to the location from which they want to use Log Anonymizer:

Code Block
titleJava binary files required by Log Anonymizer
linenumberstrue
./lib/3rd-party/org.apache.logging.log4j.log4j-slf4j-impl-2.17.2.jar
./lib/3rd-party/org.slf4j.slf4j-api-1.7.36.jar
./lib/3rd-party/snakeyaml-1.30.jar
./lib/sos/sos-commons-util-2.4.0.jar

Shell Script to run Log Anonymizer

An individual script to invoke Log Anonymizer can look like this:

Code Block
titleExample for Invocation of Log Anonymizer from an individual Script on Unix
linenumberstrue
#!/bin/sh

JAVA_BIN="${JAVA_HOME}/bin/java"
test -x "${JAVA_BIN}" || JAVA_BIN="java"

script_dir=$(dirname "$0")
cp="-classpath \"${script_dir}/lib/sos/*:${script_dir}/lib/3rd-party/*:${script_dir}/lib/*:${script_dir}/lib\""

"${JAVA_BIN}" ${JAVA_OPTIONS} ${cp} com.sos.commons.util.loganonymizer.SOSLogAnonymizer $*
Code Block
titleExample for Invocation of Log Anonymizer from an individual Script on Windows
linenumberstrue
@echo off

set JAVA_BIN=java.exe
if exist "%JAVA_HOME%\bin\java.exe" set JAVA_BIN=%JAVA_HOME%\bin\java.exe

set script_dir=%~dp0
set cp=-classpath "%script_dir%lib\sos\*;%script_dir%lib\3rd-party\*;%script_dir%lib\*;%script_dir%lib"

"%JAVA_BIN%" %JAVA_OPTIONS% %cp% com.sos.commons.util.loganonymizer.SOSLogAnonymizer %*


Explanation:

  • The directory hierarchy is assumed like this:
    • log-anonymizer.sh | .cmd
      • lib
        • 3rd-party
          • org.apache.logging.log4j.log4j-slf4j-impl-2.17.2.jar
          • org.slf4j.slf4j-api-1.7.36.jar
          • snakeyaml-1.30.jar
        • sos
          • sos-commons-util-2.4.0.jar