TAG action

<< Click to Display Table of Contents >>

Navigation:  Event and Object Analysis > Capture Results Filtering > Filtration Basics > Rules > Actions >

TAG action

Adds a tag (number label) to the message metadata.

Description

This action adds a numeric tag to the message metadata. Objects may have multiple tags separated by a comma (,) or a semicolon (;). If the same tag is set for an object more than once, its "level" (the numeric value) increases.  In other words, each tag has an internal counter, which shows how many times the tag was set for this object.

You can use filter conditions to verify whether the tag is set and check its counter (how many times it was set for this object) in order to make decisions.

The counter is increased by 1 by default when the tag is set. If you want to increase it by more than 1, you can specify the increment step after the tag name in parentheses: "TAG(...)". For example, SPAM(3) increases the counter for the SPAM tag by 3, while SPAM(1) is equal to SPAM. This may be useful for conditions having different significance, importance or priority but setting the same tag.

Counter change values may be negative. SPAM(-3) decreases the counter for the SPAM tag by 3.

Format

<action name="tag" value="<tag list>" />

or

<action name="tag" > tag list </action>

The "name" attribute:

The name attribute contains the action name: name="tag".

The "value" attribute:

The value="..." attribute enlists names of the tags.

Tag names can also be enlisted directly in the <action> tag.

Example

<action name="tag" value="SPAM" />

Sets the tag named "SPAM".

<action name="tag" value="SPAM(3)" />

Sets the tag named "SPAM" and increases its counter by 3.

<action name="tag" value="SPAM, shopping" />

Sets tags named "SPAM" and "shopping".

<action name="tag" value="SPAM(3), shopping(2)" />

Sets tags named "SPAM" and "shopping" and increases their counters by 3 and 2, respectively.

<action name="tag" value="SPAM, shopping">VIP-OFFICE</action>

Also sets tags names "SPAM" and "shopping".

<action name="tag" value="SPAM, shopping">VIP-OFFICE</action>

Sets tags named "SPAM", "shopping", "VIP-OFFICE".

Example

Mark requests to popular Russian mail services with the RUS_MAIL tag.

<?xml version="1.0" encoding="utf-8"?>
<filter name="TEST" version="1.0">
 <comment>This is the comment for the filter.</comment>
 <table name="main">
 
   <rule enabled="true">
     <comment>
       Mark requests to popular Russian mail services
       with the RUS_MAIL tag.
     </comment>
     <match>
       <c name="req-header"
          headername="Host"
          op="eq"
          value="win.mail.ru" />
       <c name="req-header"
          headername="Host"
          op="eq"
          value="mail.yandex.ru" />
       <c name="req-header"
          headername="Host" op="eq"
          value="mail.rambler.ru" />
     </match>
     <action name="tag" value="RUS_MAIL"/>
   </rule>
 
   <rule enabled="true">
     <match><c name="all"/></match>
     <action name="accept" />
   </rule>
 
 </table>
</filter>