Member since
07-29-2020
531
Posts
274
Kudos Received
159
Solutions
My Accepted Solutions
Title | Views | Posted |
---|---|---|
331 | 09-07-2024 12:59 AM | |
438 | 09-03-2024 12:36 AM | |
402 | 09-03-2024 12:09 AM | |
281 | 08-30-2024 06:23 AM | |
970 | 08-26-2024 04:39 PM |
04-26-2023
10:58 AM
1 Kudo
Hi, Try the following spec: [
{
// This is to remove the @ character from @type property because I could not
// figure out how to make it work in the second shift using escape character '\'
"operation": "shift",
"spec": {
"header": "&",
"resource": {
"\\@type": "resource.type",
"*": "resource.&"
}
}
},
{
"operation": "shift",
"spec": {
"resource": {
"resourceCharacteristic": {
"*": {
"name": "records[&1].propname",
"*": "records[&1].&",
"@(2,name)": "records[&1].name",
"@(2,type)": "records[&1].type",
"@(2,subtype)": "records[&1].subtype",
"@(2,drniId)": "records[&1].drniId",
"@(3,header.activityId)": "records[&1].activityId",
"@(3,header.timeStamp)": "records[&1].timeStamp"
}
}
}
}
},
{
"operation": "modify-overwrite-beta",
"spec": {
"records": {
"*": {
"value": "=join(',', @(1,value))"
}
}
}
}
] If that helps please accept solution. Thanks
... View more
04-20-2023
11:03 AM
1 Kudo
Hi , Can you replace the following: {
"operation": "shift",
"spec": {
"properties": {
"*": {
// simple match. Put the value '4' in the output under the "Rating" field
"title": "Questions[&1].question",
"type": {
"number": {
"#select": "Questions[&3].type"
},
"string": {
"#textarea": "Questions[&3].type"
},
"array": {
"#multiselect": "Questions[&3].type"
}
},
"$": "Questions[&1].id"
}
} with the following spec: {
"operation": "shift",
"spec": {
"properties": {
"*": {
// simple match. Put the value '4' in the output under the "Rating" field
"title": "Questions_&1.question",
"type": {
"number": {
"#select": "Questions_&3.type"
},
"string": {
"#textarea": "Questions_&3.type"
},
"array": {
"#multiselect": "Questions_&3.type"
}
},
"$": "Questions_&1.id"
}
}
}
}
,
{
"operation": "shift",
"spec": {
"*": "&",
"Questions_*": "Questions[]"
}
} Reference : https://stackoverflow.com/questions/70394715/remove-null-from-array-using-jolt If that helps please accept solution. Thanks
... View more
04-19-2023
09:42 AM
Hi, Can you explain on what basis are you trying to extract "options": 9876 & 9875 only and not 9874? Is it based on the index as in the first option and the second option only and ignore anything after?
... View more
04-17-2023
01:18 PM
Hi , Did you try the following: ${latitude:toDecimal():math("toRadians")} Or ${latitude:math("toRadians")}
... View more
04-17-2023
09:21 AM
Try the below spec. Again not sure if this is the most efficient way. You might need to rethink your strategy if you are dealing with a lot of data: [
{
//package all test fields into an outer object
"operation": "shift",
"spec": {
"test*": "outer.&",
"Details": "Details"
}
},
{
// Insert each outer object into Details element 0,1,..
"operation": "shift",
"spec": {
"Details": {
"*": {
"*": "Details.&1.&",
"@(3,outer)": "Details.&1.outer"
}
}
}
},
{
//Bucket each outer object (test1, test2...) into each details element
"operation": "shift",
"spec": {
"Details": {
"*": {
"*": "Details.&1.&",
"outer": {
"*": {
"@": "Details.&3.&"
}
}
}
}
}
},
{
//package details into seperate element under an Array
"operation": "shift",
"spec": {
"Details": {
"*": "[#1].Details.&"
}
}
}
]
... View more
04-16-2023
11:49 AM
Im not sure what you specified is makes sense because you would have two keys with the same name "Details" but different values. I assume what you want is this: {
"Details": {
"0": {
"test1": "test output",
"test2": "test output",
"id": "first",
"name": "the first one"
},
"1": {
"test1": "test output",
"test2": "test output",
"id": "second",
"name": "the second one"
}
}
} In this case the spec would be like this: [
{
//package all test fields into an outer object
"operation": "shift",
"spec": {
"test*": "outer.&",
"Details": "Details"
}
},
{
// Insert each outer object into Details element 0,1,..
"operation": "shift",
"spec": {
"Details": {
"*": {
"*": "Details.&1.&",
"@(3,outer)": "Details.&1.outer"
}
}
}
},
{
//Bucket each outer object (test1, test2...) into each details element
"operation": "shift",
"spec": {
"Details": {
"*": {
"*": "Details.&1.&",
"outer": {
"*": {
"@": "Details.&3.&"
}
}
}
}
}
}
] Not sure if this is the best way, if someone knows a better way please provide your suggestion. If that answers your question please accept solution. Thanks
... View more
04-16-2023
08:19 AM
Hi, You have not specified the desired output, but would the following give you what you are looking for: [
{
"operation": "shift",
"spec": {
"Details": {
"*": {
"*": "Details[#2].&"
}
},
"*": "outer[].&"
}
},
{
"operation": "shift",
"spec": {
"Details": "Details",
"outer": {
"*": {
"*": "Details[&1].&"
}
}
}
}
] if that helps please accept solution. Thanks
... View more
04-15-2023
08:23 AM
Hi, If you are looking to set the id value for the first element in the columns array you can use the following spec: [
{
"operation": "shift",
"spec": {
"columns": {
"0": {
"value": "[].@(1,name)"
}
}
}
}
] If that helps please accept solution.
... View more
04-12-2023
08:24 AM
hi, You can take a look into ForkEnrichment and JoinEnrichment processors : https://nifi.apache.org/docs/nifi-docs/components/org.apache.nifi/nifi-standard-nar/1.20.0/org.apache.nifi.processors.standard.JoinEnrichment/additionalDetails.html If that helps, please accept solution. Thanks
... View more
03-26-2023
06:10 AM
Hi, I noticed that you have an "Original" relationship going from SplitJson back to itself. This where your duplicates are coming from. The "Original" relationship means the original input flowfile that is passed to the splitJson from JoltTransformation processor. You need to terminate this relationship and not pass it to anything unless you are using Wait-Notify processors which I dont think in your case. You can terminate relationship by going to splitJson Configuration then go to the Relationship tab and check the terminate box under the Original relationship.
... View more