[ZBXNEXT-5025] Event tags in notification Created: 2019 Feb 11 Updated: 2021 May 17 Resolved: 2021 May 17 |
|
Status: | Closed |
Project: | ZABBIX FEATURE REQUESTS |
Component/s: | Server (S) |
Affects Version/s: | None |
Fix Version/s: | None |
Type: | Change Request | Priority: | Trivial |
Reporter: | Victor | Assignee: | Unassigned |
Resolution: | Fixed | Votes: | 21 |
Labels: | actions, event, notification, tags | ||
Remaining Estimate: | Not Specified | ||
Time Spent: | Not Specified | ||
Original Estimate: | Not Specified | ||
Environment: |
Any |
Issue Links: |
|
Description |
Hi! For example: if trigger has tag named "type" with value "snmp trap", using the macro {EVENT.TAGS:type} should return "snmp_trap" value. |
Comments |
Comment by Semiadmin [ 2019 May 17 ] |
This is even more important in remote commands. {EVENT.TAGS} macro often used to send value to command and it has to be a single tag value, not a comma-separated list of event tags. I think it'd be good to use macro functions: {{EVENT.TAGS}.regsub(pattern, output)} |
Comment by Lewis Lee [ 2019 Jun 12 ] |
@Semiadmin I am a newbie on Zabbix. I have similar problem on {EVENT.TAGS}.function(). I intend to use notification to sending email and snmp trap. Such that I use trigger tag to substring the Alarm ID from log content. Trigger tag work on that fine. I added the following code in operations message. However the email content is sent by that. Please advise how to apply function on {EVENT.TAGS} Operations message: AlarmID: {{EVENT.TAGS}.regsub("alarmid:([0-9]+)", \1)} <br> Expected Output: 71008 Result: AlarmID: {alarmid:71008.regsub("alarmid:([0-9]+)", \1)} |
Comment by Alexei Vladishev [ 2020 Mar 20 ] |
I believe we already support {EVENT.TAGS.<TAGNAME>} macros. Also support of a new macro {EVENT.TAGSJSON} is coming in Zabbix 5.0. |