[ZBX-16397] Zabbix Trigger Tag Regex - doesn't work Created: 2019 Jul 22  Updated: 2019 Jul 22  Resolved: 2019 Jul 22

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Templates (T)
Affects Version/s: 4.0.10
Fix Version/s: None

Type: Problem report Priority: Minor
Reporter: Vadims Kurmis Assignee: Zabbix Support Team
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Centos 7


Attachments: PNG File RegexNotWorkIssue.png    

 Description   

Steps to reproduce:

  1. Item Data:
    2019.07.22 09:37:29 some.host.com 255316 Problem: Zabbix server unavailable
    2019.07.22 09:37:29 some.host.com 255316 Resolved: Zabbix server unavailable
    

     

  2. Trigger expression:
    {Template App Zabbix Alerts:log[/var/log/alerts/alerts.log].regexp([2-9]{1}[0-9]{3}\.[0-9]{2}\.[0-9]{2} [0-9]{2}\:[0-9]{2}\:[0-9]{2} [a-zA-Z0-9._-]* [0-9]* Problem\: .*)}=1
    
  • this works fine, the problem gets generated.
  1. Trigger Tags:
    EVENT_DATE= {{ITEM.VALUE}.regsub(([2-9]{1}[0-9]{3}\.[0-9]{2}\.[0-9]{2}) ([0-9]{2}\:[0-9]{2}\:[0-9]{2}) ([a-zA-Z0-9._-]*) ([0-9]*) (Problem|Resolved)\: (.*), \1)}
    EVENT_TIME= {{ITEM.VALUE}.regsub(([2-9]{1}[0-9]{3}\.[0-9]{2}\.[0-9]{2}) ([0-9]{2}\:[0-9]{2}\:[0-9]{2}) ([a-zA-Z0-9._-]*) ([0-9]*) (Problem|Resolved)\: (.*), \2)}
    EVENT_HOST= {{ITEM.VALUE}.regsub(([2-9]{1}[0-9]{3}\.[0-9]{2}\.[0-9]{2}) ([0-9]{2}\:[0-9]{2}\:[0-9]{2}) ([a-zA-Z0-9._-]*) ([0-9]*) (Problem|Resolved)\: (.*), \3)}
    EVENT_ID= {{ITEM.VALUE}.regsub(([2-9]{1}[0-9]{3}\.[0-9]{2}\.[0-9]{2}) ([0-9]{2}\:[0-9]{2}\:[0-9]{2}) ([a-zA-Z0-9._-]*) ([0-9]*) (Problem|Resolved)\: (.*), \4)}
    EVENT_TYPE= {{ITEM.VALUE}.regsub(([2-9]{1}[0-9]{3}\.[0-9]{2}\.[0-9]{2}) ([0-9]{2}\:[0-9]{2}\:[0-9]{2}) ([a-zA-Z0-9._-]*) ([0-9]*) (Problem|Resolved)\: (.*), \5)}
    EVENT_TEXT= {{ITEM.VALUE}.regsub(([2-9]{1}[0-9]{3}\.[0-9]{2}\.[0-9]{2}) ([0-9]{2}\:[0-9]{2}\:[0-9]{2}) ([a-zA-Z0-9._-]*) ([0-9]*) (Problem|Resolved)\: (.*), "\3 \5:\6")}
    

The same regex works fine if I put in "Item Pre-Processing".

Tested it so it is correct regex.

For item configuration there is no currently any pre-processing configured.

Regex works also in Trigger expression.

But it doesn't work for Trigger Tags.

 

Result:
See screenshot...

There is also an issue with this JIRA configuration, which Zabbix has setup.

There is configured a default timeout for token, which after couple of minutes prevents from uploading files and shows error: "JIRA could not attach the file as there was a missing token. Please try attaching the file again" If I attach again it doesn't work anyway.

Can you fix this issue with your JIRA? Very frustrating, this annoys and happens every time.

People need enough time to create an issue to describe things.

This means default timeout token - is not enough and must be fixed.

See log file...
See memory dump...
Expected:
See screenshot....
See attached patch file...



 Comments   
Comment by Vadims Kurmis [ 2019 Jul 22 ]

Missed double quotes and "^", "*" tokens. Ticket can be closed.

Comment by Vadims Kurmis [ 2019 Jul 22 ]

Why there are so many syntaxes for regex in Zabbix?

I mean if Trigger expression syntax doesn't require double quotes and "^", "$", then logically this should be the same for Trigger Tags.

Generated at Sat May 03 06:51:37 EEST 2025 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.