[ZBXNEXT-5518] XML parsing in JS-preprocessing or "XML to JSON" preprocessing Created: 2019 Oct 18 Updated: 2024 Apr 10 Resolved: 2021 Jan 18 |
|
Status: | Closed |
Project: | ZABBIX FEATURE REQUESTS |
Component/s: | Proxy (P), Server (S) |
Affects Version/s: | 4.4.0 |
Fix Version/s: | 5.4.0alpha1, 5.4 (plan) |
Type: | Change Request | Priority: | Trivial |
Reporter: | Alex Alexandrov (Inactive) | Assignee: | Andrejs Kozlovs |
Resolution: | Fixed | Votes: | 2 |
Labels: | JavaScript, json, preprocessing, xml | ||
Σ Remaining Estimate: | Not Specified | Remaining Estimate: | Not Specified |
Σ Time Spent: | Not Specified | Time Spent: | Not Specified |
Σ Original Estimate: | Not Specified | Original Estimate: | Not Specified |
Attachments: |
![]() |
||||||||||||||||||||
Issue Links: |
|
||||||||||||||||||||
Sub-Tasks: |
|
||||||||||||||||||||
Team: | |||||||||||||||||||||
Sprint: | Sprint 70 (Nov 2020), Sprint 71 (Dec 2020), Sprint 72 (Jan 2021) | ||||||||||||||||||||
Story Points: | 2 |
Description |
Сurrently there is preprocessing XPath and JSONPath. If you need to implement something more complex, then Javascript is used. But if the input data is XML, then in Javascript it is impossible to perform further processing of elements (after XPath preprocessing or without), since there is no XML-parser in JS prepocessing. |
Comments |
Comment by Andris Zeila [ 2019 Oct 21 ] |
Supporting XML-parsing in JS would be quite complex task. The simplest way would be adding XML->JSON->XML conversion to JS (not a new preprocessing step). This way it could be also used by webhooks. However there is no straightforward conversion possible, some translation rules would need to be set. |
Comment by Alex Alexandrov (Inactive) [ 2019 Oct 21 ] |
Dear Andris Zeila, it is possible to give the user the opportunity to choose the method of XML to JSON conversion (for example, to convert the attributes of a node as a field of JSON or nested array, etc.) |
Comment by Alex Klimov [ 2019 Oct 24 ] |
@Andris Zeila Maybe it is possible to implement an API to add custom C modules to the preprocessing chain? That would be a solution to the problem. |
Comment by Andrejs Kozlovs [ 2021 Jan 14 ] |
Available in:
|
Comment by Andrejs Kozlovs [ 2021 Jan 15 ] |
Documentation updated:
Updated API documentation: |