Example 1

Top  Previous  Next

Example 1

 

In this example, we've configured the filter script to search the message read from the input file for the text 'BIOHAZARD'. If it is found then the script will replace the current Recipient with 'bio_hazard' to indicate that all messages containing the word BIOHAZARD should go to the bio_hazard group. We're then inserting the static text 'WARNING! EXTREME HAZARD DETECTED:' before the matched search string.

 

Note: Lines prefaced with # are comment lines for description purposes. The filter ignore any lines that begin with #

 

This section of the filter configures the script to look for a static file named Example.txt in the same directory as the script and, when the script completes, it will not delete the original file and will output to a static file named Output.txt to the directory in which the script resides.

 

<InputFile>

 <Name>

         Example.txt

 </Name>

 <Delete>

         False

 </Delete>

</InputFile>

 

<OutputFile>

 <Name>

         Output.txt

 </Name>

</OutputFile>

 

<Debug>

 False

</Debug>

 

# This section of the filter configures the script to search

# for BIOHAZARD and if found, replaces the Recipient

# with bio_hazard.

<Filter>

 <Search>

         <Section>

                 Message

         </Section>

         <Type>

                 Literal

         </Type>

         <Text>

                 BIOHAZARD

         </Text>

 </Search>

 <Replace>

         <Section>

                 Recipient

         </Section>

         <Type>

                 Literal

         </Type>

         <Scope>

                 Section

         </Scope>

         <Text>

                 bio_hazard

         </Text>

 </Replace>

 <Continue>

         True

 </Continue>

</Filter>

 

# This section of the filter configures the script to insert

# WARNING! EXTREME HAZARD DETECTED: before the BIOHAZARD text

<Filter>

 <Search>

         <Section>

                 Message

         </Section>

         <Type>

                 Literal

         </Type>

         <Text>

                 BIOHAZARD

         </Text>

 </Search>

 <Replace>

         <Section>

                 Message

         </Section>

         <Type>

                 Literal

         </Type>

         <Scope>

                 Match

         </Scope>

         <Text>

                 WARNING! EXTREME HAZARD DETECTED: %Match%

         </Text>

 </Replace>

</Filter>