[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:
Duplicate

 Description   

Hi!
Need an ability to get the specific tag value in action operations (i.e. notification message text).

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.

Generated at Fri Apr 19 22:46:00 EEST 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.