【发布时间】:2021-11-02 05:49:04
【问题描述】:
这是一个简单的问题,我是 nifi 和 jolt 的新手。我只是想知道,如何在使用通配符的同时遍历 jolt 规范。例如,这是 jolt 演示站点中的示例,
输入是
{
"data": {
"1234": {
"clientId": "12",
"hidden": true
},
"1235": {
"clientId": "35",
"hidden": false
}
}
}
规格是
[
{
"operation": "shift",
"spec": {
"data": {
"*": {
"hidden": {
"true": {
// if hidden is true, then write the value disabled to the RHS output path
// Also @(3,clientId) means lookup the tree 3 levels, to the "1234" or "1235" level,
// and then come back down down the tree and grabe the value of "clientId"
"#disabled": "clients.@(3,clientId)"
},
"false": {
"#enabled": "clients.@(3,clientId)"
}
}
}
}
}
}
]
输出是
{
"clients" : {
"12" : "disabled",
"35" : "enabled"
}
}
我们是如何得到上述输出的?就像@(3,clientsid)一样。据我了解,它上升了3个级别。但是关于什么..规范或输入的3个级别?无论哪种方式,如何向上移动3个级别,您能在这里定义哪些级别吗?
提前致谢
【问题讨论】:
标签: json apache-nifi jolt