RecordPath is a powerful tool for extracting and manipulating data within structured records and data structures such as JSON or XML. It provides a concise and flexible syntax to navigate and manipulate fields, making it useful for tasks like data transformation, extraction, and filtering within data flows. RecordPath enhances the flexibility and versatility of data processing.
For a simple example, say a “name” field needs to be extracted from a JSON data object. The EvaluateJsonPath processor could be used to perform this processing, configured with:
Property Name: name
JsonPath Expression: $.name
.(dot) represents the root data structure for navigation
name is the field or attribute to access in the data structure
When processing, the “name” field is accessed and a new attribute is created with the extracted value from each record in the array, such as:
FlowFile 1: name attribute = “Alice”
FlowFile 2: name attribute = “Bob”
FlowFile 3: name attribute = “Charlie”