[ZBX-15581] Using LDD macros in preprocessing with regex not espace slash. Created: 2019 Feb 04 Updated: 2019 Feb 04 Resolved: 2019 Feb 04 |
|
Status: | Closed |
Project: | ZABBIX BUGS AND ISSUES |
Component/s: | Server (S) |
Affects Version/s: | None |
Fix Version/s: | None |
Type: | Incident report | Priority: | Major |
Reporter: | Rodrigo Leme Nunes | Assignee: | Unassigned |
Resolution: | Done | Votes: | 0 |
Labels: | None | ||
Remaining Estimate: | Not Specified | ||
Time Spent: | Not Specified | ||
Original Estimate: | Not Specified |
Attachments: | 1 - Discovery.gif 2 - itemprototype.gif 2.1 - itemprototypepreprocessing.gif 3 - Itemdiscovered.gif 4 - macroconvert-original.gif 5 - macroconvert-modified.gif |
Description |
Using LDD macros in preprocessing with regex not espace slash. changing file: Line 952 Add case '/': Print "5 - macroconvert-modified.gif"
|
Comments |
Comment by Rodrigo Leme Nunes [ 2019 Feb 04 ] |
Version: Zabbix 4.0.3 |
Comment by Glebs Ivanovskis [ 2019 Feb 04 ] |
Why should it be escaped? Forward slash is not among PCRE special characters. It is, however, often used as a delimiter (e.g. in PHP code) and delimiter needs to be escaped, but when you can pass your pattern to PCRE directly (like Zabbix does) delimiters are not required. |
Comment by Rodrigo Leme Nunes [ 2019 Feb 04 ] |
In this case the / is not valid part of expression: Example: Regular Expression: "USER I/O".?"{#WAIT}":"([^"]) Json: { "data":[ {"{#FILTRO}":"1","{#EVENTO}":"USER I/O","{#WAIT}":"12.57"}]} Does not work. Now escape / "USER I\/O".?"{#WAIT}":"([^"]) Result : 12.57 The test above can be reproduce in https://regex101.com/
|
Comment by Glebs Ivanovskis [ 2019 Feb 04 ] |
https://regex101.com/ is one of the places where delimiters are present, but you can choose them from several options, have a look - pattern without escaping "/" works like a charm when you change delimiters. There are online regexp testers that don't have delimiters exposed, see this. |
Comment by Rodrigo Leme Nunes [ 2019 Feb 04 ] |
Thanks. |
Comment by Rodrigo Leme Nunes [ 2019 Feb 04 ] |
It is not system issue. |