Skip to content

premanandc/masking-logback-json-provider

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Log Masking for JSON formatted events

Provides an extension to Logstash JSON Encoder to mask sensitive contents of log events using rules like below:

    <encoder class="net.logstash.logback.encoder.LoggingEventCompositeJsonEncoder">
      <providers>
        <timestamp>
          <timeZone>UTC</timeZone>
        </timestamp>
        <provider class="com.premonition.logging.logback.MaskingMessageProvider">
          <rules>
            <rule>
              <name>credit card</name>
              <pattern>\d{13,18}</pattern>
              <unmasked>4</unmasked>
            </rule>
            <rule>
              <name>SSN</name>
              <pattern>\d{3}-?\d{3}-?\d{4}</pattern>
            </rule>
          </rules>
        </provider>
        <stackTrace/>
        <pattern>
          <pattern>
            {
            "severity": "%level",
            "thread": "%thread",
            "class": "%logger{40}"
            }
          </pattern>
        </pattern>
      </providers>
    </encoder>

Also see

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages