Member since
02-05-2019
5
Posts
1
Kudos Received
1
Solution
My Accepted Solutions
Title | Views | Posted |
---|---|---|
1769 | 09-30-2019 03:45 PM |
10-09-2019
11:16 AM
Thank you. It really helps 😃
... View more
09-30-2019
03:45 PM
1 Kudo
I re0rder the json to {
"item":{"currency":"USD","name":"Beauty Lips"},"name":"david"
} I used ReplaceText processor search value: "item":(.*),"name" replace value: "item":${'$1':replaceFirst('"', ''):substringBeforeLast('"')},"name" It does not look beauty but it works =/ My question is why I don't need to use unexcapeJson() like this? "item":${'$1':replaceFirst('"', ''):substringBeforeLast('"'):unescapeJson()},"name"
... View more
02-05-2019
01:42 PM
@David Yu - If you are not writing any data in to the new directory, why the need to create it. NiFi FlowFiles consist of FlowFile attributes and FlowFile content. Each FlowFile will have a filename associated with it. Processors like PutHDFS are designed to operate against incoming FlowFiles and are designed to put a file to HDFS. Without a FlowFile the processor would not be triggered to connect to HDFS at all. It cab be configured to dynamically create missing directories when writing the first file to a new directory path. - If you need to create some directory structure on a regular interval (for example new directory each hour based on timestamp), You would need to use a GenerateFlowFile processor (running using cron scheduling strategy and creating a 0 byte File) that feeds a PutHDFS processor. The "Success" relationship from putHDFS should then feed to DeleteHDFS to remove the 0 byte FlowFile that was added to the newly created directory in HDFS. - Thank you, Matt - If you found this answer addressed your question, please take a moment to login in and click the "ACCEPT" link.
... View more