Support Questions

Find answers, ask questions, and share your expertise

ReplaceText Processor

Explorer

Hello!
Can't understand whats wrong...
I've got processors group to take data from json to sql.

When I try to "view as formatted" - I see this:

Use SplitJson to split file after it use ReplaceText... and he doesn't work correctly. Unable to generate view of data: Unrecognized token 'INSERT': was expecting 'null', 'true', 'false' or NaN at [Source: (BufferedInputStream); line: 1, column: 8"

77830-replacetext-processor.jpg

77834-after-replacetext.jpg

77832-after-splitjson.jpg

77831-replacement-value.jpg

1 ACCEPTED SOLUTION

Super Guru
@Vladislav Shcherbakov

Before ReplaceText processor use EvaluateJsonPath processor to extract the json values, keep as flowfile attributes.

77837-evaluatejsonpath.png

Add all your properties(case sensitive) in this processor and keep the destination as flowfile-attribute then feed the success relationship from EvaluateJsonpath to Replace text processor.

Flow:

---
--- other processors 3.SplitJson
5.EvaluateJsonPath 6.ReplaceText

View solution in original post

1 REPLY 1

Super Guru
@Vladislav Shcherbakov

Before ReplaceText processor use EvaluateJsonPath processor to extract the json values, keep as flowfile attributes.

77837-evaluatejsonpath.png

Add all your properties(case sensitive) in this processor and keep the destination as flowfile-attribute then feed the success relationship from EvaluateJsonpath to Replace text processor.

Flow:

---
--- other processors 3.SplitJson
5.EvaluateJsonPath 6.ReplaceText
Take a Tour of the Community
Don't have an account?
Your experience may be limited. Sign in to explore more.