[ZBXNEXT-3667] Global regular expressions - multiple expressions -> option to use OR Created: 2017 Jan 26  Updated: 2024 Mar 27

Status: Open
Project: ZABBIX FEATURE REQUESTS
Component/s: Server (S)
Affects Version/s: 3.2.3
Fix Version/s: None

Type: New Feature Request Priority: Major
Reporter: Oleksii Zagorskyi Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: expressions, globalregexps, regexps
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate

 Description   

Global expression combines multiple regexps using an AND operator, while in some cases ability to use OR would be required too.

For example I use a "white list" (like - "good1|good2|goodNNN...") in the global expression and it's really long, so does not fit to the 255 chars limitation.
I could split the list to several parts and put them to separate lines to workaround the 255 chars limit, but it's not a solution because I need OR between them, which is not possible currently.

Maybe the same approach, as used for actions and lld rule filters (including custom expression), could be implemented ?



 Comments   
Comment by Oleksii Zagorskyi [ 2017 Jan 26 ]

There are a bit related feature requests, but still are different ZBXNEXT-2788, ZBXNEXT-481.

Comment by Oleksii Zagorskyi [ 2017 Jan 26 ]

An ugly workaround:

Current workaround:
Created global Macros, for example: {$ZZ_WHITELIST_WARNING_1} - {$ZZ_WHITELIST_WARNING_58}
Each macro is infact a RegExp string, for example: 'Active Directory (Certificate|Domain|Federation) Services'
Limited the use of global macros as much as possible by putting as many white listed services in per macro (see example above)
Added to the filter of the Windows services discovery rule:
Type of calculation: or (A or B or C or D or E or F or G or H or I or J or K or L or M or N or O or P or Q or R or S or T or U or V or W or X or Y or Z or AA or AB or AC or AD or AE or AF or AG or AH or AI or AJ or AK or AL or AM or AN or AO or AP or AQ or AR or AS or AT or AU or AV or AW or AX or AY or AZ or BA or BB or BC or BD or BE or BF)
Labels for each RegExp macro, for example: {#SERVICEDISPLAY} matches {$ZZ_WHITELIST_WARNING_1}
This approach gives the benefit of changing the whitelist (by changing the global macros) without having to update all host that have this template
This is an ugly workaround and not easy to maintain. Hence this feature request to allow an OR in a global regular expression.

Generated at Fri Apr 26 03:05:41 EEST 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.