-
Notifications
You must be signed in to change notification settings - Fork 514
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add parse XML docs #6822
Merged
Merged
Add parse XML docs #6822
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
6f549c3
Add parse XML docs
lizsnyder 5c6e1bf
Add parse_when
lizsnyder 8efe957
Update _data-prepper/pipelines/configuration/processors/parse-xml.md
lizsnyder d9a4f10
Update _data-prepper/pipelines/configuration/processors/parse-xml.md
lizsnyder 008264a
Tweaks
lizsnyder 2d6551a
Tweaks
lizsnyder 1777ffe
Apply suggestions from code review
Naarcha-AWS File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
55 changes: 55 additions & 0 deletions
55
_data-prepper/pipelines/configuration/processors/parse-xml.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
--- | ||
layout: default | ||
title: parse_xml | ||
parent: Processors | ||
grand_parent: Pipelines | ||
nav_order: 83 | ||
--- | ||
|
||
# parse_xml | ||
|
||
The `parse_xml` processor parses XML data for an event. | ||
|
||
## Configuration | ||
|
||
You can configure the `parse_xml` processor with the following options. | ||
|
||
| Option | Required | Type | Description | | ||
| :--- | :--- | :--- | :--- | | ||
| `source` | No | String | Specifies which `event` field to parse. | | ||
| `destination` | No | String | The destination field of the parsed XML. Defaults to the root of the `event`. Cannot be `""`, `/`, or any white-space-only string because these are not valid `event` fields. | | ||
| `pointer` | No | String | A JSON pointer to the field to be parsed. The value is null by default, meaning that the entire `source` is parsed. The `pointer` can access JSON array indexes as well. If the JSON pointer is invalid, then the entire `source` data is parsed into the outgoing `event` object. If the key that is pointed to already exists in the `event` object and the `destination` is the root, then the pointer uses the entire path of the key. | | ||
| `parse_when` | No | String | Specifies under what conditions the processor should perform parsing. Default is no condition. Accepts a Data Prepper expression string following the [Data Prepper Expression Syntax]({{site.url}}{{site.baseurl}}/data-prepper/pipelines/expression-syntax/). | | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "Following" can be read as either "after" or "in accordance with" here. |
||
| `tags_on_failure` | No | String | A list of strings that specify the tags to be set if the processor fails or an unknown exception occurs while parsing. | ||
|
||
## Usage | ||
|
||
The following examples show how to use the `parse_xml` processor in your pipeline. | ||
|
||
### Example: Minimum configuration | ||
|
||
The following example shows the minimum configuration for the `parse_xml` processor: | ||
|
||
```yaml | ||
parse-xml-pipeline: | ||
source: | ||
stdin: | ||
processor: | ||
- parse_xml: | ||
source: "my_xml" | ||
sink: | ||
- stdout: | ||
``` | ||
{% include copy.html %} | ||
|
||
When the input event contains the following data: | ||
|
||
``` | ||
{ "my_xml": "<Person><name>John Doe</name><age>30</age></Person>" } | ||
``` | ||
|
||
The processor parses the event into the following output: | ||
|
||
``` | ||
{ "name": "John Doe", "age": "30" } | ||
``` |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.