Tags consist of a tag name and a tag value. When tagging entities, you can use just the name or pair it with a value (for example, mysql
, jira
, target:mysql
, service:jira
, etc.).
Tags can be defined for various entities:
Refer to the official Zabbix guidelines for general recommendations on defining tags, along with specific guidance for templates, items, triggers, and low-level discovery rules.
Tags have multiple purposes, most notably, to mark events. When entities are tagged, any new event related to a tagged entity will inherit its tags. For example:
A problem event inherits all tags from the whole chain of entities - templates, hosts, items/web scenarios, triggers. Identical tag:value
combinations (after resolved macros) are merged into one, thus avoiding duplication.
Custom event tags offer more flexibility. For example:
Entities may be tagged with the same tag name but different tag values (for example, component:memory
and component:storage
). Similarly, an entity can have a tag without a value and the same tag with a value (for example, database
and database:postgresql
). Such tags are not considered duplicates.
Some common use cases for tagging are as follows:
scope:performance
).target:mysql
).service:jira
).component:cpu
).component:cpu
tag.tag-name:{{ITEM.VALUE<N>}.regsub()}
).service:{{ITEM.VALUE<N>}.regsub()}
).scope:security
for trigger1 and scope:availability
for trigger2).scope:{#FSNAME}
).target:mysql
).Tags can be defined in a dedicated tab, for example, in trigger configuration:
Built-in and user macros in tags are resolved at the time of the event. Until the event has occurred, these macros will be shown in Zabbix frontend unresolved.
Low-level discovery macros are resolved during discovery process.
The following macros may be used in trigger tag names and values:
The following macros may be used in template, host, and item/web scenario tag names and values:
The following macros may be used in trigger-based notifications:
Substring extraction is supported for populating the tag name or tag value, using a macro function. The function applies a regular expression to the value obtained by the supported macro. For example:
{{ITEM.VALUE}.regsub(pattern, output)}
{{ITEM.VALUE}.iregsub(pattern, output)}
{{#LLDMACRO}.regsub(pattern, output)}
{{#LLDMACRO}.iregsub(pattern, output)}
If the tag name or value exceeds 255 characters after macro resolution, it will be truncated to 255 characters.
See also: Using macro functions in low-level discovery macros for event tagging.
Tags, if defined, can be viewed with new events in:
The order and number of displayed tags is determined by the Tag display priority and Show tags filtering options in Monitoring → Problems or the Problems dashboard widget. Note that a maximum of three tags can be displayed; if there are more tags, hovering over the three dots reveals all tags in a pop-up window.