The Filter Script

Top  Previous  Next

Filters can be simple or complex depending on what you want to do. The most basic filters are search and replace functions, where you remove specific patterns like XML tags from text or replace short-codes with more verbose information. The more advanced filters can conditionally modify who receives a message, what the message says and execute functions via batch file or Powershell script, among other things.

 

The filters themselves are written in XML and, to start, you may want to look at the complete filter script template. That will give you a general overview of each section and all of the possible values you could use in them.

 

To break things down, there is one major section, Filter, that determines what each section of the script will do. Additionally, there are two conditional sections, InputFile and OutputFile, plus an optional debugging mode:

 

Filter

The Filter section determines what you want to do with the data read as input. A single filter script may reference multiple individual <Filter> sections to perform multiple tasks within the same data set. It's also important to note that the filter system supports the use of Regex, allowing for a high level of customization and control.

 

InputFile

Most scripts will not need this parameter. When using the filter system in conjunction with the GetAscii interface or a FILE protocol carrier, the InputFile section determines which file(s) you want the filter to scan.

 

OutputFile

Most scripts will not need this parameter. When using the filter system in conjunction with the GetAscii interface or a FILE protocol carrier, the OutputFile section determines what you want to name the files output by the filter's modifications.

 

Debug

The Debug section determines whether you want a debug level review of the filter to appear before the filter completes its actions. This is incredibly useful when first configuring a script and we recommend that this flag be enabled until the filter is ready to put in to production.

 

For most scripts, you'll want to start with the Filter section.