1

I try to extract each element from the frequentlyBoughtTogether array and put it on a flow-attribute:

{
   frequentlyBoughtTogether: ["a","b","c"]
}

Frist step: SplitJson

enter image description here

Second step: EvaluateJsonPath to make each element a flow-file-attribute:

enter image description here

However this gives me following error:

enter image description here

When I log the failure, I can see the element in the flow-file-content, but I need it to be an attribute. Any ideas how to solve this issue?

1 Answer 1

2

Use ExtractText processor instead of EvaluateJsonPath processor.

  • in case of EvaluateJsonPath processor evaluates the flowfile content if the content is not a valid json then processor routes the flowfile to failure)
  • In case of Extract Text processor just extracts the content of the flowfile by applying the regex. ExtractText configs: enter image description here Add new property as

val

(.*)

Then processor adds new attribute names val to the flowfile by extracting the flowfile content as value.

Flow:

SplitJson->ExtractText
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.