[ZBX-20091] The find() function does not return the correct result, when using a regex, in a Trigger. Created: 2021 Oct 15  Updated: 2024 Apr 10  Resolved: 2022 Jan 31

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Server (S)
Affects Version/s: 5.4.4
Fix Version/s: 6.0 (plan)

Type: Problem report Priority: Trivial
Reporter: Josh W Assignee: Vladislavs Sokurenko
Resolution: Cannot Reproduce Votes: 0
Labels: triggers
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

RHEL 8.4


Attachments: PNG File regular_expression_test.png    
Team: Team A
Sprint: Sprint 84 (Jan 2022)
Story Points: 1

 Description   

Description:
We have a Trigger that uses the find() function.  The Trigger is firing when it should not.

Here is the expression in the Trigger:

find(/VZC EAAA/snmptrap[^\h*trap_oid\h+FNKSBRTR-MIB::funkSbrTrapRealmOutOfService\b],,"regexp","\h+FNKSBRTR-MIB::funkSbrTrapVarFailedSystemName\S*\h+\Wsandvine_test\b")=0

Here is the value in the Log item:

2021-10-14 18:14:13 TRAP INFO:
  host        xxxxxxxx1-vti-aaa1 (10.xx.xx.xx)  (uptime: 364 days, 14:59:29.33)
  trap_oid    FNKSBRTR-MIB::funkSbrTrapRealmOutOfService
  net_path    UDP: [10.xx.xx.xx]:60135->[10.xx.xx.xx]:162
VARIABLES:
  FNKSBRTR-MIB::funkSbrTrapVarComp.0                accounting (2)
  FNKSBRTR-MIB::funkSbrTrapVarSev.0                 warning (2)
  FNKSBRTR-MIB::funkSbrTrapVarFailedSystemName.0    "sandvine_test"



 Comments   
Comment by Aleksandrs Petrovs-Gavrilovs [ 2021 Oct 18 ]

Hello,

Just to specify, is that the only type of trap received by the mentioned item, or traps of some other content can be received, that do not contain specifically string:

  FNKSBRTR-MIB::funkSbrTrapVarFailedSystemName.0    "sandvine_test

Or any other traps ar recieved by the same item?

Best Regards,
Aleksandrs

 

Comment by Josh W [ 2021 Oct 19 ]

Hello Aleksandrs,

No, we are receiving other traps for:

trap_oid FNKSBRTR-MIB::funkSbrTrapRealmOutOfService

 

So we can verify that the Zabbix 'Item' catches the traps correctly. The problem is w/ the find() function in the 'Trigger'.

Thanks,

Josh

Comment by Vladislavs Sokurenko [ 2022 Jan 26 ]

Issue could not be produced, please double check that expected data is really received, tried following:
Trigger expression:

find(/Zabbix server/trap1,,"regexp","@test")=0 

Global regular expression:

Generated at Thu Apr 17 11:04:21 EEST 2025 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.