Skip to content
Martin Danielsson edited this page Jul 23, 2015 · 4 revisions

The FilterLog operator can be leveraged to log a message if a filter takes effect.

What Type
Syntax FilterOnce(filter, message)
filter bool
message string
Return type bool

The filter needs to be a boolean expression which is used to filter the source record. The evaluated filter expression is always passed 1:1 as a return value from the FilterLog operation. It does not have any effect on this, its only effect is to log the message expression as an INFO event to the currently set <Logger> instance (see Config File Documentation). This is done if and only if the filter expression evaluates to false, i.e. if the filter expression causes the source record to be filtered out.

The FilterLog operator only makes sense in a <SourceFilter> tag where it can be leveraged to inform of records which are filtered out (if you find further use for it, feel free to tell me).

Example:

<SourceFilters>
  <SourceFilter>FilterLog(Not(IsEmpty($LastName)), "For record #" + $ID + ", the LastName is empty.")</SourceFilter>
  <SourceFilter>FilterLog(IsValidEMail($EMail), "For record #" + $ID + ", the email is invalid.")</SourceFilter>
</SourceFilter>

This can be used to filter out bad quality data but still be able to explicitly see which records were filtered out.

Clone this wiki locally