I get a generated Json file from the Log Analytics API into ADF, and I want to convert it to CSV file. My Json file has this structure:
{
"tables": [
{
"name": "PrimaryResult",
"columns": [
{
"name": "PipelineName",
"type": "string"
},
{
"name": "Status",
"type": "string"
},
{
"name": "TimeGenerated",
"type": "datetime"
},
{
"name": "_ResourceId",
"type": "string"
},
{
"name": "Type",
"type": "string"
}
],
"rows": [
[
"Get_Tables",
"Succeeded",
"2023-09-04T08:15:48.77315Z",
"/subscriptions/144612ca-37be-4643-9c80-5706a350bdb2/resourcegroups"
],
[
"LogAnaytics",
"Succeeded",
"2023-09-04T08:15:55.073672Z",
"/subscriptions/providers/microsoft.datafactory/factories",
"ADFPipelineRun"
]
]
}
]
}
I tried to flaten, firstly table than columns than rows like this: but it did not work. I want to get a result in csv like this:
To achieve your requirement, follow below steps, I took your sample Json and transformed it:
For Columns
For Rows
Now using Union transformation combine the rows and columns
data preview:
Now, using sink transformation load data into CSV
Output: