Use StringMatchFilter when you want to filter messages based on a string in the log event message.


<filter class="StringMatchFilter">
<param name="StringToMatch" value="character-string"/>
<param name="AcceptOnMatch" value="TRUE | FALSE"/>

Syntax Description

name="StringToMatch" value="character-string"
specifies the string to search for in the log event message.
name="AcceptOnMatch" value="TRUE | FALSE"
specifies whether to accept or deny the log event when the log event message contains character-string. Valid values are TRUE or FALSE:
specifies to accept the log event.
specifies to deny the log event.


To use this filter you specify a character string, and you specify whether to accept or deny the log event if the filter character string matches a character string in the log event message. If there is no match, the filtering process continues with the next filter in the filtering policy. If there are no other filters in the filtering policy and if the log event has not been denied, the appender accepts and processes the log event.


The following filter definition does not accept log events that contain the string "RETURN":
<filter class="StringMatchFilter">
   <param name="StringToMatch" value="RETURN"/>
   <param name="AcceptOnMatch" value="true"/>