TAG Action

<< Click to Display Table of Contents >>

Navigation:  Event and Object Analysis > Capture Results Filtering > Prefiltering HTTP Requests > Actions >

TAG Action

Adds a tag (a numeric label) to the object metadata.

Description

This action sets a tag (a numeric label) in the object metadata. There may be more than one tag. In this case, they must be separated by a comma ',' or a semicolon ';'. If the same tag is set for an object more than once, the "level" of the tag (its numeric value) is increased. Each tag has an internal counter that shows how many times this tag has been set for this object.

You can then use a filter condition to check if a tag exists and what is its counter value (how many times the tag has been set for the current object) to make decisions.

The default increment of the value is 1. If you need to increase the value by more than 1, specify the increment value after the tag name in parentheses: "TAG(...)". For example, SPAM(3) increases the counter value for the SPAM tag by 3, and SPAM(1) is equal to SPAM. This may be helpful if conditions that set the same tag have different relevance/importance/priority.

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

Please note:
The set tags will be available in the message filter conditions, if a message was extracted from this HTTP object.

Format

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

 
or

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

The "name" attribute:

The name attribute specifies the name of the action - name="tag".

The "value" attribute:

The value="..." attribute lists tag names.

You can also provide names in the <action> tag.

Example 1:

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

Sets a tag named "SPAM".

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

Sets the tag named "SPAM" and increases its value 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.

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

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

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

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

Example 2:

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>Filter comment.</comment>
 <table name="main">
 
   <rule enabled="true">
     <comment>
       Mark requests to popular Russian mail services
       with 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>