Class StructuredDataFilter
java.lang.Object
org.apache.logging.log4j.core.AbstractLifeCycle
org.apache.logging.log4j.core.filter.AbstractFilter
org.apache.logging.log4j.core.filter.MapFilter
org.apache.logging.log4j.core.filter.StructuredDataFilter
- All Implemented Interfaces:
Filter
,LifeCycle
,LifeCycle2
@Plugin(name="StructuredDataFilter",
category="Core",
elementType="filter",
printObject=true)
public final class StructuredDataFilter
extends MapFilter
Filter based on data in a StructuredDataMessage.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.logging.log4j.core.filter.AbstractFilter
AbstractFilter.AbstractFilterBuilder<B extends AbstractFilter.AbstractFilterBuilder<B>>
Nested classes/interfaces inherited from interface org.apache.logging.log4j.core.Filter
Filter.Result
Nested classes/interfaces inherited from interface org.apache.logging.log4j.core.LifeCycle
LifeCycle.State
-
Field Summary
Fields inherited from class org.apache.logging.log4j.core.filter.AbstractFilter
onMatch, onMismatch
Fields inherited from class org.apache.logging.log4j.core.AbstractLifeCycle
DEFAULT_STOP_TIMEOUT, DEFAULT_STOP_TIMEUNIT, LOGGER
Fields inherited from interface org.apache.logging.log4j.core.Filter
ELEMENT_TYPE, EMPTY_ARRAY
-
Method Summary
Modifier and TypeMethodDescriptionstatic StructuredDataFilter
createFilter
(KeyValuePair[] pairs, String oper, Filter.Result match, Filter.Result mismatch) Creates the StructuredDataFilter.Context Filter method.Appender Filter method.protected Filter.Result
filter
(StructuredDataMessage message) Methods inherited from class org.apache.logging.log4j.core.filter.MapFilter
filter, filter, filter, filter, filter, filter, filter, filter, filter, filter, filter, filter, filter, getMap, getStringMap, isAnd, toString
Methods inherited from class org.apache.logging.log4j.core.filter.AbstractFilter
equalsImpl, filter, filter, getOnMatch, getOnMismatch, hashCodeImpl
Methods inherited from class org.apache.logging.log4j.core.AbstractLifeCycle
getState, getStatusLogger, initialize, isInitialized, isStarted, isStarting, isStopped, isStopping, setStarted, setStarting, setState, setStopped, setStopping, start, stop, stop, stop
-
Method Details
-
filter
Description copied from class:AbstractFilter
Appender Filter method. The default returns NEUTRAL. -
filter
Description copied from class:AbstractFilter
Context Filter method. The default returns NEUTRAL. -
filter
-
createFilter
@PluginFactory public static StructuredDataFilter createFilter(@PluginElement("Pairs") KeyValuePair[] pairs, @PluginAttribute("operator") String oper, @PluginAttribute("onMatch") Filter.Result match, @PluginAttribute("onMismatch") Filter.Result mismatch) Creates the StructuredDataFilter.- Parameters:
pairs
- Key and value pairs.oper
- The operator to perform. If not "or" the operation will be an "and".match
- The action to perform on a match.mismatch
- The action to perform on a mismatch.- Returns:
- The StructuredDataFilter.
-