-
Notifications
You must be signed in to change notification settings - Fork 508
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
Fixes table in Data Prepper write_json processor #7518
Conversation
Signed-off-by: Heather Halter <[email protected]>
@@ -13,6 +13,6 @@ The `write_json` processor converts an object in an event into a JSON string. Yo | |||
|
|||
| Option | Description | Example | | |||
| :--- | :--- | :--- | | |||
| source | Mandatory field that specifies the name of the field in the event containing the message or object to be parsed. | If `source` is set to `"message"` and the input is `{"message": {"key1":"value1", "key2":{"key3":"value3"}}`, then the `write_json` processor generates `{"message": "{\"key1\":\"value`\", \"key2\":"{\"key3\":\"value3\"}"}"`. | |||
| target | An optional field that specifies the name of the field in which the resulting JSON string should be stored. If `target` is not specified, then the `source` field is used. | |||
| source | Mandatory field that specifies the name of the field in the event containing the message or object to be parsed. | If `source` is set to `"message"` and the input is `{"message": {"key1":"value1", "key2":{"key3":"value3"}}}`, then the `write_json` processor generates `{"message": "{\"key1\":\"value\", \"key2\":{\"key3\":\"value3\"}}"}`. |
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.
Is there a reason the example needed to change? Also, adding the line at the end will fix the table.
| source | Mandatory field that specifies the name of the field in the event containing the message or object to be parsed. | If `source` is set to `"message"` and the input is `{"message": {"key1":"value1", "key2":{"key3":"value3"}}}`, then the `write_json` processor generates `{"message": "{\"key1\":\"value\", \"key2\":{\"key3\":\"value3\"}}"}`. | |
| source | Mandatory field that specifies the name of the field in the event containing the message or object to be parsed. | If `source` is set to `"message"` and the input is `{"message": {"key1":"value1", "key2":{"key3":"value3"}}}`, then the `write_json` processor generates `{"message": "{\"key1\":\"value\", \"key2\":{\"key3\":\"value3\"}"}"`. | |
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.
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.
@dlvenable is going to take a look and help clarify.
@@ -13,6 +13,6 @@ The `write_json` processor converts an object in an event into a JSON string. Yo | |||
|
|||
| Option | Description | Example | | |||
| :--- | :--- | :--- | | |||
| source | Mandatory field that specifies the name of the field in the event containing the message or object to be parsed. | If `source` is set to `"message"` and the input is `{"message": {"key1":"value1", "key2":{"key3":"value3"}}`, then the `write_json` processor generates `{"message": "{\"key1\":\"value`\", \"key2\":"{\"key3\":\"value3\"}"}"`. | |||
| target | An optional field that specifies the name of the field in which the resulting JSON string should be stored. If `target` is not specified, then the `source` field is used. | |||
| source | Mandatory field that specifies the name of the field in the event containing the message or object to be parsed. | If `source` is set to `"message"` and the input is `{"message": {"key1":"value1", "key2":{"key3":"value3"}}}`, then the `write_json` processor generates `{"message": "{\"key1\":\"value\", \"key2\":{\"key3\":\"value3\"}}"}`. |
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.
I just noticed two small errors. This should be:
"{\"key1\":\"value1\",\"key2\":{\"key3\":\"value3\"}}"
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.
To clarify, the part that is generated should be:
"{\"key1\":\"value1\",\"key2\":{\"key3\":\"value3\"}}"
You have a value
instead of value1
and also a space. The string will not have any spaces, and this may be a significant change.
@@ -13,6 +13,6 @@ The `write_json` processor converts an object in an event into a JSON string. Yo | |||
|
|||
| Option | Description | Example | | |||
| :--- | :--- | :--- | | |||
| source | Mandatory field that specifies the name of the field in the event containing the message or object to be parsed. | If `source` is set to `"message"` and the input is `{"message": {"key1":"value1", "key2":{"key3":"value3"}}`, then the `write_json` processor generates `{"message": "{\"key1\":\"value`\", \"key2\":"{\"key3\":\"value3\"}"}"`. | |||
| target | An optional field that specifies the name of the field in which the resulting JSON string should be stored. If `target` is not specified, then the `source` field is used. | |||
| source | Mandatory field that specifies the name of the field in the event containing the message or object to be parsed. | If `source` is set to `"message"` and the input is `{"message": {"key1":"value1", "key2":{"key3":"value3"}}}`, then the `write_json` processor generates `{"message": "{\"key1\":\"value\", \"key2\":{\"key3\":\"value3\"}}"}`. |
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.
Also, we might want to reword this.
then the
write_json
processor generates
What is really happening is that write_json
changes the existing event to look like what you show.
So perhaps:
then the
write_json
outputs the event
Signed-off-by: Naarcha-AWS <[email protected]>
Signed-off-by: Naarcha-AWS <[email protected]>
@dlvenable: Mind taking another look at this one? |
* fixtable Signed-off-by: Heather Halter <[email protected]> * Apply suggestions from code review Signed-off-by: Naarcha-AWS <[email protected]> * Update write_json.md Signed-off-by: Naarcha-AWS <[email protected]> --------- Signed-off-by: Heather Halter <[email protected]> Signed-off-by: Naarcha-AWS <[email protected]> Co-authored-by: Naarcha-AWS <[email protected]> (cherry picked from commit f2d1cd5) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
…7518) * fixtable Signed-off-by: Heather Halter <[email protected]> * Apply suggestions from code review Signed-off-by: Naarcha-AWS <[email protected]> * Update write_json.md Signed-off-by: Naarcha-AWS <[email protected]> --------- Signed-off-by: Heather Halter <[email protected]> Signed-off-by: Naarcha-AWS <[email protected]> Co-authored-by: Naarcha-AWS <[email protected]> Signed-off-by: [email protected] <[email protected]>
…7518) * fixtable Signed-off-by: Heather Halter <[email protected]> * Apply suggestions from code review Signed-off-by: Naarcha-AWS <[email protected]> * Update write_json.md Signed-off-by: Naarcha-AWS <[email protected]> --------- Signed-off-by: Heather Halter <[email protected]> Signed-off-by: Naarcha-AWS <[email protected]> Co-authored-by: Naarcha-AWS <[email protected]> Signed-off-by: Sander van de Geijn <[email protected]>
Description
Fixes the table and the JSON.
Issues Resolved
Closes #7457
Version
all
Frontend features
If you're submitting documentation for an OpenSearch Dashboards feature, add a video that shows how a user will interact with the UI step by step. A voiceover is optional.
Checklist
For more information on following Developer Certificate of Origin and signing off your commits, please check here.