Previous Page | Next Page

Filters

Filter Examples


Example 1: Filter for a Specific User's Error Messages

In this example, the filtering policy writes to the Windows Event Log the messages whose log event threshold is ERROR and which are issued by user sasuser1:

<?xml version "1.0" encoding="UTF-8"?>
   <logging:configuration xmlns: logging="http://www.sas.com/xml/logging/1.0/">
      <appender name="eventLog" class="WindowsEventAppender">
         <param name="AppName" value="SAS Foundation"/>
         <layout>
            <param name="ConversionPattern" 
                          value="%d  % -5p  [%t]  %c  (%F:%L) %u  -  %m"/>
         </layout>
         <filter class="AndFilter">
            <param="AcceptOnMatch" value="true"/>
            <filter class="LevelMatchFilter">
               <param="LevelToMatch" value="error"/>
               <param="AcceptOnMatch" value="true"/>
           </filter>
           <filter class="StringMatchFilter">
              <param="StingToMatch" value="sasuser1"/>
              <param="AcceptOnMatch" value="true"/>
            </filter>
        </filter>
        <filter class="DenyAllFilter">
        </filter>
      </appender>
      <root>
         <level valuel="trace"/>
          <appender-ref ref="eventLog"/>
      </root>
</logging:configuration>


Example 2: Filter for a Specific Date

The following filtering policy denies log events that were sent on 2008-09-22:

<filter class="StringMatchFilter">
   <param="StringToMatch" value="2008-09-22"/>
   <param="AcceptOnMatch" value="false"/>
</filter>
<filter class="DenyAllFilter">
</filter>

Previous Page | Next Page | Top of Page