Convert Json array into csv using NifiCreate ArrayList from arrayHow do I check if an array includes an object in JavaScript?Can comments be used in JSON?How to append something to an array?What is the correct JSON content type?Why does Google prepend while(1); to their JSON responses?Loop through an array in JavaScriptHow do I remove a particular element from an array in JavaScript?For-each over an array in JavaScript?Convert Json array into csv using apache Nifi
How to creep the reader out with what seems like a normal person?
Why do Ichisongas hate elephants and hippos?
A non-technological, repeating, visible object in the sky, holding its position in the sky for hours
Will tsunami waves travel forever if there was no land?
In gnome-terminal only 2 out of 3 zoom keys work
Can I get candy for a Pokemon I haven't caught yet?
Does the EU Common Fisheries Policy cover British Overseas Territories?
Asahi Dry Black beer can
Was it really necessary for the Lunar Module to have 2 stages?
How to determine the actual or "true" resolution of a digital photograph?
Colliding particles and Activation energy
Reverse the word in a string with the same order in javascript
Where did the extra Pym particles come from in Endgame?
Weird result in complex limit
If Earth is tilted, why is Polaris always above the same spot?
Confusion about capacitors
How deep to place a deadman anchor for a slackline?
Python "triplet" dictionary?
Has any spacecraft ever had the ability to directly communicate with civilian air traffic control?
Confused by notation of atomic number Z and mass number A on periodic table of elements
Find the coordinate of two line segments that are perpendicular
gnu parallel how to use with ffmpeg
What does YCWCYODFTRFDTY mean?
What is a Recurrent Neural Network?
Convert Json array into csv using Nifi
Create ArrayList from arrayHow do I check if an array includes an object in JavaScript?Can comments be used in JSON?How to append something to an array?What is the correct JSON content type?Why does Google prepend while(1); to their JSON responses?Loop through an array in JavaScriptHow do I remove a particular element from an array in JavaScript?For-each over an array in JavaScript?Convert Json array into csv using apache Nifi
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;
I'm looking to convert JSON with an array to csv format. The number of elements inside the array is dynamic for each row. I tried using this flow, ( attached the flow file xml on the post ).
GetFile --> ConvertRecord --> UpdateAttribute --> PutFile
Are there any other alternatives?
JSON format:
"LogData":
"Location":"APAC",
"product":"w1"
,
"Outcome":[
"limit":"0",
"pri":"3",
"result":"pass"
,
"limit":"1",
"pri":"2",
"result":"pass"
,
"limit":"5",
"priority":"1",
"result":"fail"
],
"attr":
"vers":"1",
"datetime":"2018-01-10 00:36:00"
Expected output in csv:
location, product, limit, pri, result, vers, datetime
APAC w1 0 3 pass 1 2018-01-10 00:36:00
APAC w1 1 2 pass 1 2018-01-10 00:36:00
APAC w1 5 1 fail 1 2018-01-10 00:36:00
Output from the attached flow:
LogData,Outcome,attr
"MapRecord[product=w1, Location=APAC]","[MapRecord[limit=0, result=pass, pri=3], MapRecord[limit=1, result=pass, pri=2], MapRecord[limit=5, result=fail]]","MapRecord[datetime=2018-01-10 00:36:00, vers=1]"
ConvertRecord Config:
JSONTReeReader Controller service Config:
CSVRecordSetWriter Controller service Config:
Avroschmeregistry Contoller service config:
Avro schema:
"name": "myschema", "type": "record", "namespace": "myschema", "fields": ["name": "LogData","type": "name": "LogData", "type": "record", "fields": [ "name": "Location", "type": "string", "name": "product", "type": "string" ],"name": "Outcome","type": "type": "array", "items": "name": "Outcome_record","type": "record","fields": [ "name": "limit","type": "string" , "name": "pri","type": ["string","null"] , "name": "result","type": "string" ] ,"name": "attr","type": "name": "attr", "type": "record", "fields": [ "name": "vers", "type": "string", "name": "datetime", "type": "string" ] ]
arrays json apache-nifi
add a comment |
I'm looking to convert JSON with an array to csv format. The number of elements inside the array is dynamic for each row. I tried using this flow, ( attached the flow file xml on the post ).
GetFile --> ConvertRecord --> UpdateAttribute --> PutFile
Are there any other alternatives?
JSON format:
"LogData":
"Location":"APAC",
"product":"w1"
,
"Outcome":[
"limit":"0",
"pri":"3",
"result":"pass"
,
"limit":"1",
"pri":"2",
"result":"pass"
,
"limit":"5",
"priority":"1",
"result":"fail"
],
"attr":
"vers":"1",
"datetime":"2018-01-10 00:36:00"
Expected output in csv:
location, product, limit, pri, result, vers, datetime
APAC w1 0 3 pass 1 2018-01-10 00:36:00
APAC w1 1 2 pass 1 2018-01-10 00:36:00
APAC w1 5 1 fail 1 2018-01-10 00:36:00
Output from the attached flow:
LogData,Outcome,attr
"MapRecord[product=w1, Location=APAC]","[MapRecord[limit=0, result=pass, pri=3], MapRecord[limit=1, result=pass, pri=2], MapRecord[limit=5, result=fail]]","MapRecord[datetime=2018-01-10 00:36:00, vers=1]"
ConvertRecord Config:
JSONTReeReader Controller service Config:
CSVRecordSetWriter Controller service Config:
Avroschmeregistry Contoller service config:
Avro schema:
"name": "myschema", "type": "record", "namespace": "myschema", "fields": ["name": "LogData","type": "name": "LogData", "type": "record", "fields": [ "name": "Location", "type": "string", "name": "product", "type": "string" ],"name": "Outcome","type": "type": "array", "items": "name": "Outcome_record","type": "record","fields": [ "name": "limit","type": "string" , "name": "pri","type": ["string","null"] , "name": "result","type": "string" ] ,"name": "attr","type": "name": "attr", "type": "record", "fields": [ "name": "vers", "type": "string", "name": "datetime", "type": "string" ] ]
arrays json apache-nifi
Could you update the question withRecord Reader/Writer
controller service schemas?
– Shu
Mar 22 at 20:41
updated with the screenshots of all the configuration and the avro schema details.
– vishwanatha handadi
Mar 23 at 3:03
add a comment |
I'm looking to convert JSON with an array to csv format. The number of elements inside the array is dynamic for each row. I tried using this flow, ( attached the flow file xml on the post ).
GetFile --> ConvertRecord --> UpdateAttribute --> PutFile
Are there any other alternatives?
JSON format:
"LogData":
"Location":"APAC",
"product":"w1"
,
"Outcome":[
"limit":"0",
"pri":"3",
"result":"pass"
,
"limit":"1",
"pri":"2",
"result":"pass"
,
"limit":"5",
"priority":"1",
"result":"fail"
],
"attr":
"vers":"1",
"datetime":"2018-01-10 00:36:00"
Expected output in csv:
location, product, limit, pri, result, vers, datetime
APAC w1 0 3 pass 1 2018-01-10 00:36:00
APAC w1 1 2 pass 1 2018-01-10 00:36:00
APAC w1 5 1 fail 1 2018-01-10 00:36:00
Output from the attached flow:
LogData,Outcome,attr
"MapRecord[product=w1, Location=APAC]","[MapRecord[limit=0, result=pass, pri=3], MapRecord[limit=1, result=pass, pri=2], MapRecord[limit=5, result=fail]]","MapRecord[datetime=2018-01-10 00:36:00, vers=1]"
ConvertRecord Config:
JSONTReeReader Controller service Config:
CSVRecordSetWriter Controller service Config:
Avroschmeregistry Contoller service config:
Avro schema:
"name": "myschema", "type": "record", "namespace": "myschema", "fields": ["name": "LogData","type": "name": "LogData", "type": "record", "fields": [ "name": "Location", "type": "string", "name": "product", "type": "string" ],"name": "Outcome","type": "type": "array", "items": "name": "Outcome_record","type": "record","fields": [ "name": "limit","type": "string" , "name": "pri","type": ["string","null"] , "name": "result","type": "string" ] ,"name": "attr","type": "name": "attr", "type": "record", "fields": [ "name": "vers", "type": "string", "name": "datetime", "type": "string" ] ]
arrays json apache-nifi
I'm looking to convert JSON with an array to csv format. The number of elements inside the array is dynamic for each row. I tried using this flow, ( attached the flow file xml on the post ).
GetFile --> ConvertRecord --> UpdateAttribute --> PutFile
Are there any other alternatives?
JSON format:
"LogData":
"Location":"APAC",
"product":"w1"
,
"Outcome":[
"limit":"0",
"pri":"3",
"result":"pass"
,
"limit":"1",
"pri":"2",
"result":"pass"
,
"limit":"5",
"priority":"1",
"result":"fail"
],
"attr":
"vers":"1",
"datetime":"2018-01-10 00:36:00"
Expected output in csv:
location, product, limit, pri, result, vers, datetime
APAC w1 0 3 pass 1 2018-01-10 00:36:00
APAC w1 1 2 pass 1 2018-01-10 00:36:00
APAC w1 5 1 fail 1 2018-01-10 00:36:00
Output from the attached flow:
LogData,Outcome,attr
"MapRecord[product=w1, Location=APAC]","[MapRecord[limit=0, result=pass, pri=3], MapRecord[limit=1, result=pass, pri=2], MapRecord[limit=5, result=fail]]","MapRecord[datetime=2018-01-10 00:36:00, vers=1]"
ConvertRecord Config:
JSONTReeReader Controller service Config:
CSVRecordSetWriter Controller service Config:
Avroschmeregistry Contoller service config:
Avro schema:
"name": "myschema", "type": "record", "namespace": "myschema", "fields": ["name": "LogData","type": "name": "LogData", "type": "record", "fields": [ "name": "Location", "type": "string", "name": "product", "type": "string" ],"name": "Outcome","type": "type": "array", "items": "name": "Outcome_record","type": "record","fields": [ "name": "limit","type": "string" , "name": "pri","type": ["string","null"] , "name": "result","type": "string" ] ,"name": "attr","type": "name": "attr", "type": "record", "fields": [ "name": "vers", "type": "string", "name": "datetime", "type": "string" ] ]
arrays json apache-nifi
arrays json apache-nifi
edited Mar 23 at 3:02
vishwanatha handadi
asked Mar 22 at 19:19
vishwanatha handadivishwanatha handadi
124
124
Could you update the question withRecord Reader/Writer
controller service schemas?
– Shu
Mar 22 at 20:41
updated with the screenshots of all the configuration and the avro schema details.
– vishwanatha handadi
Mar 23 at 3:03
add a comment |
Could you update the question withRecord Reader/Writer
controller service schemas?
– Shu
Mar 22 at 20:41
updated with the screenshots of all the configuration and the avro schema details.
– vishwanatha handadi
Mar 23 at 3:03
Could you update the question with
Record Reader/Writer
controller service schemas?– Shu
Mar 22 at 20:41
Could you update the question with
Record Reader/Writer
controller service schemas?– Shu
Mar 22 at 20:41
updated with the screenshots of all the configuration and the avro schema details.
– vishwanatha handadi
Mar 23 at 3:03
updated with the screenshots of all the configuration and the avro schema details.
– vishwanatha handadi
Mar 23 at 3:03
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55306473%2fconvert-json-array-into-csv-using-nifi%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55306473%2fconvert-json-array-into-csv-using-nifi%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Could you update the question with
Record Reader/Writer
controller service schemas?– Shu
Mar 22 at 20:41
updated with the screenshots of all the configuration and the avro schema details.
– vishwanatha handadi
Mar 23 at 3:03