Skip to content

Support parsing JSON #831

@dlvenable

Description

@dlvenable

Is your feature request related to a problem? Please describe.

Data Prepper events may have JSON values inside Event fields. Data Prepper should be able to parse these JSON strings and create fields directly in the Event from the JSON.

Describe the solution you'd like

Provide a JSON parsing processor - parse_json.

It should be able to parse a JSON string from a field and set the values in the Event object. This processor will automatically support nesting.

Example

Given the following configuration:

processor:
  parse_json:
    source: my_field

Given this input event:

"my_field" : "{\"key1\" : \"value1\", \"key2\" : \"value2\"}"

The input event is changed to:

"my_field" : "{\"key1\" : \"value1\", \"key2\" : \"value2\"}"
"key1" : "value1"
"key2" : "value2"

Example with Nesting

Given this input event:

"my_field" : "{\"key1\" : \"value1\", \"key2\" : { \"key2child\" : \"innerValue\" }}"

The input event is changed to:

"my_field" : "{\"key1\" : \"value1\", \"key2\" : \"value2\"}"
"key1" : "value1"
"key2" : {
  "key2child" : "innerValue"
}

Configurations

source - the field with JSON
target - the field to set the values in; by default this is the root object

Metadata

Metadata

Labels

enhancementNew feature or requestplugin - processorA plugin to manipulate data in the data prepper pipeline.

Type

No type

Projects

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions