Support Questions

Find answers, ask questions, and share your expertise
Announcements
Welcome to the upgraded Community! Read this blog to see What’s New!

JOlT spec help to parse JSON

avatar
New Contributor

How can I do what I’ve sent below in jolt schema ?

 

{
"cloudCeiling" : [ 1097, null, 1005, 1005],
"dayOfWeek" : [ "Tuesday", "Tuesday", "Tuesday", "Tuesday" ],
"dayOrNight" : [ "D", "N", "N", "N"],
"expirationTimeUtc" : [ 1613538000, 1613534400, 1613530800, 1613527200]
}

 

converto to 

 

[ {
"cloudCeiling" ,"1097"
"dayOfWeek","Tuesday",
"dayOrNight","D",
"expirationTimeUtc","1613538000"
}, {
"cloudCeiling" ,""
"dayOfWeek","Tuesday",
"dayOrNight","N",
"expirationTimeUtc","1613534400"
}, {
"cloudCeiling" ,"1005"
"dayOfWeek","Tuesday",
"dayOrNight","N",
"expirationTimeUtc","1613530800"
}, {
"cloudCeiling" ,"1005"
"dayOfWeek","Tuesday",
"dayOrNight","N",
"expirationTimeUtc","1613527200"
}]

2 REPLIES 2

avatar
New Contributor

I’ve done like this but it didnt work

 

[{
  "operation": "shift",
  "spec": {
      "*": {
        "*": {
             "*": "[#2].&"
               }
           }
       }
     }
   ]

 

 

[ { "1097" : null, "Tuesday" : null, "D" : null, "1613538000" : null},
{ "Tuesday" : null, "N" : null, "1613534400" : null},
{ "1005" : null, "Tuesday" : null, "N" : null, "1613530800" : null},
{ "1005" : null, "Tuesday" : null, "N" : null, "1613527200" : null} ]

avatar
New Contributor

I solved problem thank you

 

 

[{
  "operation": "shift",
  "spec": {
      "cloudCeiling": {  "*": "[&].cloudCeiling"  },
      "dayOfWeek": {   "*": "[&].dayOfWeek"},
      "dayOrNight": {    "*": "[&].dayOrNight"},
      "expirationTimeUtc": { "*": "[&].expirationTimeUtc"}
              }
}]

Labels