需要帮助JOLT规范将JSON从共享输入格式转换为预期格式。
输入JSON:
{
"DataModel": {
"Header": {
"TMS_ID": "2030617701",
"PROCESS_CD": "WvWellHeader",
"BATCH_ID": "30772",
"RECORD_COUNT": "1",
"SOURCE_SYSTEM": "WELLVIEW",
"SOURCE_RECORD_ID": "2030617701",
"TARGET_SYSTEM": "EDW",
"TRANSACTION_TYPE": "NEW",
"SOURCE_CREATE_DATE": "2017-03-29T10:18:00-05:00",
"KEY": {
"ELEMENT_NAME": "KEY_PAIRS",
"ELEMENT_VALUE": "WvWellHeader?Idrec=7052A964B7EB45D684CC3849E3ED5848"
},
"DELETE_FL": "N"
},
"Data": "H4sIAAAAAAAAA42UXW+bMBSGr7dfYWnSAA=="
}
}
预期的JSON
{
"TMS_ID" :"2030617701",
"PROCESS_CD" :"WvWellHeader",
"BATCH_ID" :"30772",
"SOURCE_SYSTEM" :"WELLVIEW",
"SOURCE_RECORD_ID" :"2030617701",
"ELEMENT_VALUE" :"WvWellHeader?Idrec=7052A964B7EB45D684CC3849E3ED5848",
"DELETE_FL" :"N",
"Data" : "HH4sIAAAAAAAAA42UXW+bMBSGr7dfYWnSAA=="
}
答案 0 :(得分:1)
规范让您入门
[
{
"operation": "shift",
"spec": {
"DataModel": {
"Header": {
"TMS_ID": "TMS_ID",
"KEY": {
"ELEMENT_VALUE": "ELEMENT_VALUE"
}
}
}
}
}
]
可生产
{
"TMS_ID" : "2030617701",
"ELEMENT_VALUE" : "WvWellHeader?Idrec=7052A964B7EB45D684CC3849E3ED5848"
}
在http://jolt-demo.appspot.com运行它并阅读/播放示例。