I'm trying to use Jolt to transform from a JSON array to another one. It consists of a nested JSON array with no keys.
Here is my input:
[
[
"20190207101456",
1,
2,
3
],
[
"20190207101456",
4,
5,
6
]
]
And I would like to get the following output:
[
{
"timestamp": "20190207101456",
"value1": 1,
"value2" : 2,
"value3" : 3
},
{
"timestamp": "20190207101456",
"value1": 4,
"value2" : 5,
"value3" : 6
}
]
I was able to add the keys with this spec file for just a single nested array element:
[
{
"operation": "shift",
"spec": {
"0": "timestamp",
"1": "value1",
"2": "value2",
"3": "value3"
}
}
]
But I don't know how to apply this for the outer JSON array.