Created 01-16-2019 07:21 PM
I have nifi cluster summarry json data like this;
[{ "nodeId": "29bed24c-6d73-4652-930b-0065cad4ef66", "address": "b1518aec7e38", "apiPort": 8080, "status": "CONNECTED", "heartbeat": "01/16/2019 16:24:32 UTC", "roles": ["Primary Node", "Cluster Coordinator"], "activeThreadCount": 0, "queued": "0 / 0 bytes", "events": [{ "timestamp": "01/16/2019 15:21:50 UTC", "category": "INFO", "message": "Received first heartbeat from connecting node. Node connected." }, { "timestamp": "01/16/2019 15:21:48 UTC", "category": "INFO", "message": "Connection requested from existing node. Setting status to connecting." }], "nodeStartTime": "01/16/2019 15:20:44 UTC" }, { "nodeId": "22aofpp4-87rf-asf4-930b-0065cad4ef66", "address": "b67uf98tkl5", "apiPort": 8080, "status": "CONNECTED", "heartbeat": "01/16/2019 16:24:32 UTC", "roles": [], "activeThreadCount": 0, "queued": "0 / 0 bytes", "events": [{ "timestamp": "01/16/2019 15:21:50 UTC", "category": "INFO", "message": "Received first heartbeat from connecting node. Node connected." }, { "timestamp": "01/16/2019 15:21:48 UTC", "category": "INFO", "message": "Connection requested from existing node. Setting status to connecting." }], "nodeStartTime": "01/16/2019 15:20:44 UTC" }]
I want only nodeId and status fields from this json. Output what i want;
{ "nodeIds": ["node1Id", "node2Id"], "status": ["node1Status", "node2Status"] }
For example output what i want;
{ "nodeIds": ["29bed24c-6d73-4652-930b-0065cad4ef66", "22aofpp4-87rf-asf4-930b-0065cad4ef66"], "status": ["CONNECTED", "CONNECTED"] }
But I couldn't do Jolt Specification for this. How can i do this?
Created 01-16-2019 07:21 PM
I solved the problem. I used this solution;
[ { "operation": "shift", "spec": { "*": { "nodeId": "node_ids", "status": "node_status" } } } ]
Created 01-16-2019 07:21 PM
I solved the problem. I used this solution;
[ { "operation": "shift", "spec": { "*": { "nodeId": "node_ids", "status": "node_status" } } } ]