Support Questions
Find answers, ask questions, and share your expertise

[Newbe Question] ConvertRecord | JSON with multiple Records to CSV

[Newbe Question] ConvertRecord | JSON with multiple Records to CSV

New Contributor

I have a JSON file with multiple records, i would like to convert the json to one CSV file with all the records.

 

{
   "results":[
      {
         "series":[
            {
               "name":"solcast",
               "columns":[
                  "time",
                  "mean_value"
               ],
               "values":[
                  [
                     1.6157196E18,
                     1973.9182926829262
                  ],
                  [
                     1.6157232E18,
                     1939.7282520325189
                  ]
               ]
            }
         ]
      }
   ]
}

 

what already did worked is to isolate the records with splitJson this leads to:

 

[[1.6157196E18,1973.9182926829262],[1.6157232E18,1939.7282520325189]]

 

all shorted, ~20 records in json and json split

 

how do i get this converted to csv ?

 

i'm very new to nifi, tool looks great, but since 2-3 days i don't get it managed.

 

inside the converter i tried with jsontreereader - avroschme - csvwriter

 

Lars_LE_0-1615735484976.png

with differnt schems... without success

 

could somebody help ? 

 

 

remark:

the value tuple is a timestamp and value itself double... more or less the query result of an influxdb query

 

my test scenario is:

 

Lars_LE_1-1615735689721.png

 

thanks in advance Lars