Member since
06-24-2021
7
Posts
0
Kudos Received
0
Solutions
01-17-2023
12:28 AM
Hi I have a JSON that includes a "headers" key. All the keys and values in the "headers" value should be sent as an HTTP request header. For example, I have this JSON. {"menu": {
"id": "file",
"value": "File",
"popup": {
"menuitem": [
{"value": "New", "onclick": "CreateNewDoc()"},
{"value": "Open", "onclick": "OpenDoc()"},
{"value": "Close", "onclick": "CloseDoc()"}
]
},
"headers": {"Accept-Charset": "utf-8",
"Accept-Language": "en-US",
"N_header_key":"n_header_val"}
}} I want to send all the values of "headers" as HTTP request headers using invokeHTTP. Is there any way to send the headers dynamically?
... View more
Labels:
- Labels:
-
Apache NiFi
11-08-2022
12:44 PM
Hi, I'm only able to do that via two processors: 1- JotlTransfomJSON : this is to add desired attributes (attr_id & attr_name) to the flowfile json using the following spec: [
{
"operation": "shift",
"spec": {
"#${attr_id}":"attr_id",
"#${attr_name}":"attr_name",
"model": "model",
"cars_drivers": {
"*": {
"id": "cars_drivers[#2].id",
"name": "cars_drivers[#2].name",
"is_processed": "cars_drivers[#2].is_processed"
}
}
}
}
] 2 - UpdateRecord Processor: Once the attributes are added to the Json , you can update those records Is_processed value only when the id matches the attr_id and name matches the attr_name. To do that set the following properties: a- Replacement Value Strategy: Literal Value b- /cars_drivers[*]/id[.=../../../attr_id]/../name[.=../../../attr_name]/../is_processed : 1 Hope that helps, if it does please accept solution.
... View more
10-30-2022
11:36 AM
Hi I want to get the key of JSON based on nested value EXAMPLE JSON {
"menu": {
"id": "file",
"value": "File",
"sample1": {
"menuitem": {
"value": "Done",
"onclick": "CreateNewDoc()"
}
},
"sample2": {
"menuitem": {
"value": "New",
"onclick": "CreateNewDoc()"
}
},
"sample3": {
"menuitem": {
"value": "New",
"onclick": "CreateNewDoc()"
}
}
}
} I want to have the first sample* where the menu.sample*.menuitem.value = New based on the example JSON the return value should be "sample2" Another example {
"menu": {
"id": "file",
"value": "File",
"sample1": {
"menuitem": {
"value": "Done",
"onclick": "CreateNewDoc()"
}
},
"sample2": {
"menuitem": {
"value": "Done",
"onclick": "CreateNewDoc()"
}
},
"sample3": {
"menuitem": {
"value": "New",
"onclick": "CreateNewDoc()"
}
}
}
} The return value should be "sample3" Is this applicable using Nifi
... View more
Labels:
- Labels:
-
Apache NiFi
08-10-2022
12:55 PM
2 Kudos
Hi, you can use ReplaceText by setting the Evaluation Mode property to "Line-by-Line", then set the "Line-by-Line Evalaution Mode" to "Last Line". In the Replacement Value set it to Empty String Set and the Search Value leave as "(?s)(^.*$)" as seen in the screenshot below: If you find this helpful please accept solution. Thanks
... View more
07-31-2022
06:21 PM
@KhASQ , Besides @SAMSAL solution, you can also use ReplaceText to eliminate the need of extracting the entire content as an attribute. You'd still have to set a large enough buffer, though, to ensure your largest message could be processed. Cheers, André
... View more
08-31-2021
01:58 PM
Hi Apache spark will initiate connection to your db on that port only via jdbc , so you can open a firewall where sources are your nodes ips and destination is your db server ip on the port you specified. Best Regards
... View more
06-28-2021
02:59 AM
Hi @KhASQ For Watermarking use any framework/db to update values once job is successfully. If you are using kafka then kafka itself you can store kafka related watermarking. Other than kafka you want to use then choose any RDBMS or HBase table.
... View more