[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: PNG File Selection_140.png    
Issue Links:
Duplicate
is duplicated by ZBXNEXT-6322 Introduce XML parser to JS preprocess... Closed
is duplicated by ZBXNEXT-4037 Item pre-processing for LLD rules Closed
Sub-task
part of ZBXNEXT-6394 Templates for Hikvision video cameras Closed
Sub-Tasks:
Key
Summary
Type
Status
Assignee
ZBXNEXT-6334 Frontend changes for XML parsing in J... Specification change (Sub-task) Closed Ivo Kurzemnieks  
Team: Team C
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.
It would be very convenient to add either XML to JSON rule, or support library for XML-parsing in JS preprocessing.



 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. ZBXNEXT-5523

Comment by Andrejs Kozlovs [ 2021 Jan 14 ]

Available in:

Comment by Andrejs Kozlovs [ 2021 Jan 15 ]

Documentation updated:

Updated API documentation:

Generated at Wed Apr 30 07:04:37 EEST 2025 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.