Class IncludeExcludeHeaderFilter

java.lang.Object
net.logstash.logback.composite.accessevent.IncludeExcludeHeaderFilter
All Implemented Interfaces:
HeaderFilter

public class IncludeExcludeHeaderFilter extends Object implements HeaderFilter
A simple HeaderFilter that determines whether or not a header is included based on a set of included header names or excluded header names. If both includes and excludes are empty, then all header names will be included. If includes is not empty and excludes is empty, then only those headers in the includes will be included. If includes is empty and excludes is not empty, then all headers except those in the excludes will be included. If includes is not empty and excludes is not empty, then an exception will be thrown. All comparisons are case-insensitive.
  • Constructor Details

    • IncludeExcludeHeaderFilter

      public IncludeExcludeHeaderFilter()
  • Method Details

    • includeHeader

      public boolean includeHeader(String headerName, String headerValue)
      Description copied from interface: HeaderFilter
      Returns true if the given header should be included in the log event output
      Specified by:
      includeHeader in interface HeaderFilter
      Parameters:
      headerName - the header name
      headerValue - the header value
      Returns:
      true if the given header should be included in the log event output
    • getIncludes

      public Set<String> getIncludes()
    • getExcludes

      public Set<String> getExcludes()
    • addInclude

      public void addInclude(String include)
    • removeInclude

      public void removeInclude(String include)
    • addExclude

      public void addExclude(String exclude)
    • removeExclude

      public void removeExclude(String exclude)