Member since
11-01-2017
9
Posts
0
Kudos Received
1
Solution
My Accepted Solutions
Title | Views | Posted |
---|---|---|
1107 | 04-04-2018 10:05 AM |
11-10-2018
08:35 PM
I have done by using executescript processor first I have taken data model { "EntityType": { "Type": "string", "Value": "" }, "EntityName": { "Type": "string", "Value": "" }, "EntityId": { "Type": "string", "Value":"" } inside execute script processor i have written logic for binding our data {"EntityType":"person","EntityName":"Ankit","EntityId":"11"} into this datamodel i am using ECMAScript for this task script :- flowFile = session.get(); if (flowFile != null) { var StreamCallback = Java.type("org.apache.nifi.processor.io.StreamCallback") var IOUtils = Java.type("org.apache.commons.io.IOUtils") var StandardCharsets = Java.type("java.nio.charset.StandardCharsets") flowFile = session.write(flowFile, new StreamCallback(function(inputStream, outputStream) { var text = IOUtils.toString(inputStream, StandardCharsets.UTF_8) var Productiondata = JSON.parse(text) //this is data like key value pair String Datamodel = flowfile.getAttribute("Datamodel"); //taking datamodel from variable for (var defaultData in defaultJsonStrObj) //after that iterating and binding it { defaultJsonStrObj[defaultData]["Value"]=Productiondata[defaultData] } outputStream.write(JSON.stringify(defaultJsonStrObj, null, '\t').getBytes(StandardCharsets.UTF_8)) } })) flowFile = session.putAttribute(flowFile, "filename", flowFile.getAttribute('filename').split('.')[0]+'_translated.json') session.transfer(flowFile, REL_SUCCESS) }
... View more
11-08-2018
09:04 AM
i have one json data model like:- {
"Details": {
"EntityType": {
"Type": "string",
"Value": ""
},
"EntityName": {
"Type": "string",
"Value": ""
},
"EntityId": {
"Type": "string",
"Value": ""
}} and i have one json that is key value pair like { "EntityType":"person", "EntityName":"Ankit", "EntityId":"11" } i want to do my key value json mapping into datamodel. Desired output:- { "Details": { "EntityType": { "Type": "string", "Value": "person" }, "EntityName": { "Type": "string", "Value": "Ankit" }, "EntityId": { "Type": "string", "Value": "11" }} if anybody knows about it please share your knowledge
... View more
Labels:
- Labels:
-
Apache NiFi
09-14-2018
01:02 AM
Hi All, I have the following requirement: Split a single NiFi flowfile into multiple flowfilesof each of the flowfiles as a separate data Sample input flowfile: fieldname value id 1 name ankit address ____ id 2 name john address ______ Desired output files: Flowfile 1: fieldname value id 1 name ankit address ____ Flowfile 2: fieldname value id 2 name john address ______ .
... View more
Labels:
- Labels:
-
Apache NiFi
04-04-2018
10:05 AM
@Matt Clarke i have solved this issue for plain ftp i have given username as a "anonymous" . so now it is working.
... View more
04-03-2018
06:39 AM
Labels:
- Labels:
-
Apache NiFi
03-22-2018
02:14 PM
I am not getting what you explained can you please elaborate? for database connection, I have used GETFTP processor.
... View more
03-22-2018
11:51 AM
Labels:
- Labels:
-
Apache NiFi