This feature is available as an add-on for the Honeycomb Enterprise plan.
Please contact your Honeycomb account team for details.
Description
The Parse XML Processor is utilized to parse XML document strings from specified fields within log, metric, or trace data. It’s particularly useful when your telemetry data contains a serialized XML document, and you need to convert them into a structured format for easier analysis and filtering. The processor supports specifying the source field and the target field for the parsed XML data, offering flexibility in handling diverse data structures.Use
When dealing with telemetry data that includes an XML document embedded within logs, metrics, or traces, the Parse XML Processor becomes instrumental. For instance, logs from certain applications or systems might contain XML documents representing specific attributes or metadata. By utilizing the Parse XML Processor, these XML documents can be parsed and converted into structured data, enhancing readability and facilitating more complex queries and analyses.Multiline XMLIt’s common for XML to be formatted to span multiple lines.
When reading XML logs from a file, make sure to configure the multiline section of the File source to properly read the whole XML document.
- All character data for an XML element is trimmed and placed in the
contentfield. - The tag for an XML element is trimmed and placed in a
tagfield. - The attributes for an XML element is placed as a mapping of attribute name to attribute value in the
attributefield. - Processing instructions, directives, and comments are ignored and not represented in the parsed XML.
- All child XML elements are parsed as above, and placed in an array in a
childrenfield.
Configuration
Example Configurations
Parse XML from Logs
In this example, we have a basic log that details an action and the user that triggered the action, like an audit log. This log is in XML format, and we’d like to parse the content into a structured log.
parsed_xml attribute, we can configure the Parse XML processor as follows:
- Telemetry:
Logs - Condition:
true - Source Field Type:
Body - Source Field: Left empty
- Target Field Type:
Attribute - Target Field:
parsed_xml