Member since
08-10-2022
27
Posts
1
Kudos Received
2
Solutions
My Accepted Solutions
| Title | Views | Posted |
|---|---|---|
| 3239 | 03-16-2023 02:57 AM | |
| 14153 | 08-29-2022 04:50 AM |
03-15-2023
10:18 AM
Hello, hope someone can point me in the right direction. I need to delete all files starting with some attributes value, so based on Linux way it should be something like this: rm -f /opt/my_path/myfile_* I decided to use Execute Stream Command in this way: The path seem correct, the command generated, pasted into a Linux shell is working fine, however the processor did not delete the files. If i try with a specific file it works fine. Seems that * is not permitted, any clue? Many Thanks to everybody...
... View more
Labels:
- Labels:
-
Apache NiFi
10-11-2022
08:22 AM
Thanks for the update, however that's is the problem. The Query Record does not fit my needs cause cannot implement the logic. Note that the json doesn't have always all situation codes, so the pseudo code should be: Grab the element with sit_code = POD only if present, otherwise go further with others. Any help is appreciate. Many Thanks
... View more
10-11-2022
07:34 AM
Hi guys, hope anyone can point me on the right direction. I have the following flow file: [ {
"version" : "5",
"type" : "REPORT",
"dp_code" : "DHA592",
"field4" : "83482227299911",
"field5" : "83482227299911",
"platform_name" : "GHESTEM LA CHAPELLE",
"field7" : "01143200",
"field8" : "72801371220938",
"field9" : "72801371220938",
"carrier_name" : "",
"shipper_name" : "",
"field12" : "",
"consignee_name" : "",
"consignee_code" : "",
"consignee_address" : "",
"consignee_city" : "",
"field17" : "",
"ldc_number" : "",
"ldc_date" : "",
"shipment_number" : "2022115144",
"shipment_code" : "2022115144/SH",
"field22" : "",
"field23" : "",
"field24" : "",
"field25" : "liv.cfm",
"situation_code" : "LIV",
"justification_code" : "CFM",
"situation_date" : "20221003",
"feedback_date" : "202210061222",
"anomaly_packages_number" : "",
"comments" : "",
"new_appointment_date" : "",
"field33" : "",
"field34" : "",
"field35" : "",
"assigned" : "",
"field37" : "",
"agreed_tax" : "",
"field39" : "",
"field40" : "20221006123304-3f621cf7-3",
"field41" : "",
"field42" : "",
"field43" : "",
"field44" : "212059",
"doc_url" : "",
"field46" : "",
"field47" : "",
"field48" : ""
}, {
"version" : "5",
"type" : "REPORT",
"dp_code" : "DHA592",
"field4" : "83482227299911",
"field5" : "83482227299911",
"platform_name" : "GHESTEM LA CHAPELLE",
"field7" : "01143200",
"field8" : "72801371220938",
"field9" : "72801371220938",
"carrier_name" : "",
"shipper_name" : "",
"field12" : "",
"consignee_name" : "",
"consignee_code" : "",
"consignee_address" : "",
"consignee_city" : "",
"field17" : "",
"ldc_number" : "",
"ldc_date" : "",
"shipment_number" : "2022115144",
"shipment_code" : "2022115144/SH",
"field22" : "",
"field23" : "",
"field24" : "",
"field25" : "",
"situation_code" : "POD",
"justification_code" : "CFM",
"situation_date" : "20221003",
"feedback_date" : "202210061208",
"anomaly_packages_number" : "",
"comments" : "",
"new_appointment_date" : "",
"field33" : "",
"field34" : "",
"field35" : "",
"assigned" : "",
"field37" : "",
"agreed_tax" : "",
"field39" : "",
"field40" : "20221006121304-3f61f8b6-3",
"field41" : "",
"field42" : "",
"field43" : "",
"field44" : "212059",
"doc_url" : "",
"field46" : "",
"field47" : "",
"field48" : "S"
}, {
"version" : "5",
"type" : "REPORT",
"dp_code" : "DHA592",
"field4" : "83482227299911",
"field5" : "83482227299911",
"platform_name" : "GHESTEM LA CHAPELLE",
"field7" : "01143200",
"field8" : "72801371220938",
"field9" : "72801371220938",
"carrier_name" : "",
"shipper_name" : "",
"field12" : "",
"consignee_name" : "",
"consignee_code" : "",
"consignee_address" : "",
"consignee_city" : "",
"field17" : "",
"ldc_number" : "",
"ldc_date" : "",
"shipment_number" : "2022115144",
"shipment_code" : "2022115144/SH",
"field22" : "",
"field23" : "",
"field24" : "",
"field25" : "",
"situation_code" : "AAR",
"justification_code" : "CFM",
"situation_date" : "20221003",
"feedback_date" : "202210061208",
"anomaly_packages_number" : "",
"comments" : "",
"new_appointment_date" : "",
"field33" : "",
"field34" : "",
"field35" : "",
"assigned" : "",
"field37" : "",
"agreed_tax" : "",
"field39" : "",
"field40" : "20221006121304-3f61f8b6-3",
"field41" : "",
"field42" : "",
"field43" : "",
"field44" : "212059",
"doc_url" : "",
"field46" : "",
"field47" : "",
"field48" : "S"
} ] My need is to grab only one element of json file based on "situation_code" in a priority order. To explain me well, situation code can have the following possible values: POD (search priority 1) LIV (search priority 2) AAR (search priority 3) TTR (search priority 4) The logic behind should be the following: Grab only one entire element by evaluating at first POD as value, if found grab it, if not found then evaluate LIV and grab it in case, if not found then evaluate AAR and grab it, and so on until you found a possible value. Many thanks for any hints
... View more
Labels:
- Labels:
-
Apache NiFi
09-13-2022
03:23 AM
@SAMSALthank you for the solution provided. Testing the solution provided i was aware the sometimes the fields vaues(string) are different. Sometime are in the form 20220807091252 which includes also hours and minutes, sometime 202209080. So i need to have a conversion process before in order to convert into datetime. Am i right? Do you came across this? Many thanks
... View more
09-12-2022
10:54 AM
Hi community, hope someone can help me on below. My Flow File content is something like this: [ {
"version" : "5",
"shipment_number" : "2022065597",
"situation_code" : "MLV",
"justification_code" : "CFM",
"situation_date" : "202206071253",
"new_appointment_date" : "202301081253",
}, {
"version" : "5",
"shipment_number" : "2022065597",
"situation_code" : "MLV",
"justification_code" : "CFM",
"situation_date" : "202206071252",
"new_appointment_date" : "",
} ] I need to add a Query Record processor in order to grab only one JSON record for each Flow File. The condition is: Get a single result with highest value of situation_date or new_appointment_date. Just to explain better, the logic behind should be the following: Grab the max of situation_date, the max of new_appointment_date and compare each other, then take the highest of the comparison and get entire JSON record. In MYSQL or T-SQL it could be easier, but if i understand well Query Record is based on Apache Calcite which is not so easy for me. Does anyone can point mee on the right direction? Appreciate
... View more
Labels:
- Labels:
-
Apache NiFi
08-29-2022
04:50 AM
Hi, many thanks for your help. The solution provided works like a charm!!!!
... View more
08-22-2022
05:12 AM
1 Kudo
Hi, thanks for your guidelines. I am currently on vacation....I will test it once i will come back and sure, i will mark as solved if it works as expected... In a while....many thanks
... View more
08-11-2022
02:21 AM
Your assumption is correct, however..... My original flow file contains some attributes, as mentioned, and some json content. After that i run ExecuteSQL processor which retrieve the information i would like to append to the original flowfile but.... The resulting flow file coming from success relationship of ExecuteSQL is only the resultset of the query and the original flow file is totally overwritten. The result i want to achieve is the following: 1 - Original flow file Contents: { 'list_price':100, 'discount':10, } Attributes: year = 2018 brand = audi 2 - ExecuteSQl to fetch a model 3 - Append model to original flow file as an additional attribute like this: Contents: { 'list_price':100, 'discount':10, } Attributes: year = 2018 brand = audi model=A3 What have i missing here? Many Thanks
... View more
08-10-2022
09:25 AM
Hi to all, let's say i have a flow file with some given attributes. What i want to achieve is to add flow attribute with a new one those value is retrieved from SQL Server query, where 2 existing attributes is passed in where clause(of course will return only one result) Just for example Current Flow file: year = 2018 brand = audi I would add a third attribute called "model" with value retrieved from a following query: "SELECT model FROM cars WHERE year=${year} AND brand=${brand}" I've searched around but not still found a good answer.... Tried evaluating lookup services but still not usable in this scenario. Can anyone can point me on the right direction? Many Thanks
... View more
Labels:
- Labels:
-
Apache NiFi
- « Previous
-
- 1
- 2
- Next »