[ZBX-12500] Item preprocessing: Output condition is not applied if value does not match expression pattern Created: 2017 Aug 10 Updated: 2018 Oct 09 Resolved: 2017 Sep 07 |
|
Status: | Closed |
Project: | ZABBIX BUGS AND ISSUES |
Component/s: | Server (S) |
Affects Version/s: | 3.4.0rc1 |
Fix Version/s: | 3.4.2rc1, 4.0.0alpha1, 4.0 (plan) |
Type: | Problem report | Priority: | Trivial |
Reporter: | Anna Kucenko (Inactive) | Assignee: | Andris Zeila |
Resolution: | Fixed | Votes: | 0 |
Labels: | preprocessing, regexps | ||
Remaining Estimate: | Not Specified | ||
Time Spent: | Not Specified | ||
Original Estimate: | Not Specified |
Team: | Team C |
Sprint: | Sprint 15, Sprint 16 |
Story Points: | 0.5 |
Description |
Steps: Result: Dependent item is ‘Not supported’ bacause of: |
Comments |
Comment by Glebs Ivanovskis (Inactive) [ 2017 Aug 10 ] |
In this case you can utilize full power of PCRE's lookahead: ([0-9]+(?= days)|(?![0-9]+ days)) This captures number which is followed by " days" or captures empty string if there is no number followed by " days". This way there will always be \1 to replace. But that's just a workaround in case someone needs it... |
Comment by Andris Zeila [ 2017 Aug 30 ] |
It seems like 'feature' of our regular expression matching logic - if the input text does not match pattern, then the resulting output is empty string, it does not replace groups with empty strings in the output pattern. There are several ways how we could proceed:
The choosen solution is in bold. |
Comment by Andris Zeila [ 2017 Aug 31 ] |
Fixed in development branch svn://svn.zabbix.com/branches/dev/ZBX-12500 |
Comment by Andris Zeila [ 2017 Sep 06 ] |
Released in:
|
Comment by Andris Zeila [ 2017 Sep 06 ] |
(1) [D] Documented in: martins-v Reviewed, with a tiny grammar fix. CLOSED |