It is possible to delete properties that were used to create new properties by setting to true the delete- after-use attribute in the corresponding key-property , if the incoming event is a mutable one. Otherwise, the properties are not deleted and a warning is logged. See Mutable and Immutable Events section.
In this example, a property is to be deleted that is only used to create new properties. Once deleted, it will not be sent to the other processing elements.
The departmt property is to be created using the group property, then the group property must be deleted. Every group with value grp-dep12-swt has to be in dep-12 for departmt . Every group with value grp-dep12-rtr has to be in dep-12 for departmt . Every group with value grp-dep13-hst has to be in dep-13 for departmt. Every group with value grp-dep14-ftp has to be in dep-14 for departmt.
Example configuration file:
<?xml version="1.0" encoding="UTF-8"?> <property-tagging-filter-config xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance xsi:schemaLocation="http://www.watch4net.com/APG/Filter/PropertyTaggingFilter property-tagging-filter-config.xsd" xmlns="http://www.watch4net.com/APG/Filter/PropertyTaggingFilter"> <refresh unit="minutes">20</refresh> <files> <text-file path="conf/input.data"> <field-separator>,</field-separator> <default-symbol>***</default-symbol> <key-properties> <key-property delete-after-use="true" string-type="string">group</key-property> </key-properties> <new-properties> <new-property>departmt</new-property> </new-properties> </text-file> </files> </property-tagging-filter-config>
As indicated, the fifth event still has its group property set after passing through the filtering because it did not match a line from the input file. As well, since there was no 'default value' configured, the fifth event has equally not had its property replaced.