Member since
08-01-2021
58
Posts
14
Kudos Received
7
Solutions
My Accepted Solutions
| Title | Views | Posted |
|---|---|---|
| 3452 | 11-18-2022 09:06 AM | |
| 5163 | 11-15-2022 05:46 PM | |
| 3443 | 10-12-2022 03:18 AM | |
| 2624 | 10-11-2022 08:52 AM | |
| 6479 | 10-08-2022 08:23 AM |
11-18-2022
09:06 AM
After testing, in order to remove a variable you need to send an update request where that variable's value is null.
... View more
11-18-2022
08:25 AM
A couple of reasons: At the base level, operations in the UI all use the REST API - if you use chrome's devtools and go to the networking tab, you can see the exact REST API route used for every click you do on the canvas. If you'd ever want to automate something you know you can manually do in the UI, using this trick you can perfectly replicate it with with RESTful calls. In the same vain, the REST API has far more routes/operations available. The CLI tools seems to have around ~70 operations, whilst the rest api seems to have over 200. The CLI commands are part of the nifi toolkit. Whilst the toolkit does get updated, I believe it does not get the same level of attention as nifi's main codebase and as such it'd be better not to rely on it completely. This is not to say you can't use the CLI tool - rather, just my opinion on the matter and some insight for how my team writes automations on nifi 🙂
... View more
11-18-2022
12:02 AM
Hey @syntax_ , Here is the documentation on NIFI's toolkit CLI commands. It seems there are commands for "pg-stop" and "pg-start", which I believe will allow you to start/stop and manage specific flows inside your canvas by using their IDs. Personally, I would recommend you use NIFI's REST API for automations rather than CLI commands. Hope this helps 🙂
... View more
11-15-2022
06:11 PM
Hello Miguel, There are probably ways to optimize tha amount of processors you use, but as a start I would try and monitor where the slowness comes from. Is there any backpressure in the flow (files queueing up before a processor)? Are you sending requests at the same rate? if so does that mean those 6000 records/second you lost translate to 5xx responses from nifi to the origin service? In terms of optimizing, perhaps you can transform null values with your initial JoltTransformJson. it sounds like you use a lot of ReplaceText processors too - perhaps UpdateRecord would be of more use for updating your fields. I'd recommend looking at QueryRecord for your validation/routing instead of using UpdateAttribute -> RouteOnAttribute (if applicable and you route based on the json fields).
... View more
11-15-2022
05:56 PM
Hello Mahendra, Have you tried sending an update request that includes all the variables except the one you wish to delete? If that doesn't work I'll run some tests next time I'm at office and post an update.
... View more
11-15-2022
05:46 PM
1 Kudo
For your attempt to use only a CSVReader, have you configured the "timestamp" property in the controller service to describe a format that includes microseconds? I have encountered a very similar issue in the past. In my case, I was writing avro files using PutDatabaseRecord which already had their schema as part of the file. The schema itself was incorrect and would describe date fields as strings - as such, when I'd write to my DB (which had a date with milliseconds percision type), the milliseconds would get cut out and presumably some default parsing would allow the rest of the date to be written correctly. I the solution I found was to turn my avro files into CSV, then use a CSVReader in my PutDatabaseRecord processor. In my case, configuring the timestamp format to include milliseconds ( .SSS in the end) would end up allowing the processor to write the records to the DB correctly without any data loss.
... View more
10-21-2022
07:54 AM
In the end, I never found a perfect solution and just opted to use attributes and RouteOnAttribute. If you find ValidateXML can actually verify all the checks you need, it shouldn't be too bad using a ConvertRecord processor and transforming JSON to XML for the validation (or perhaps just straight up using XMLs instead of jsons if that fits your use case)
... View more
10-12-2022
03:18 AM
1 Kudo
Perhaps JoltTransformRecord could help you. The jolt transformation "shift" let's you rename fields - in a csv file's case, headers. If you know all your replaces ahead of time, you could define a transformation like: { operation: shift spec: { "kgg":"g", "c34":"c", "*":"&" } } Note the last shift, "*":"&" , which would transfer over the rest of the headers you didn't specifically rename.
... View more
10-11-2022
08:52 AM
1 Kudo
Perhaps you can use the processor CalculateRecordStats to count how many records of each situation code you have in a given file, then once that is put in your attributes you can try a couple of different methods to decide what to do, for example you can use RouteOnAttribute and then check if attribute sit_code.pod>0 then send to extract_one_pod_element and there you could use QueryRecord to take out exactly one POD element, otherwise route to LIV, AAR, etc.
... View more
10-11-2022
07:49 AM
I believe you could use QueryRecord to take you in the right direction. You could define properties to route files based on their situation code, for example: Key: POD Value: SELECT * FROM flowfile WHERE situation_code = 'POD' LIMIT 1 This would route 1 element in your input array where the code is POD to the new relationship "POD" (same as the dynamic property name). This doesn't exactly match your case of retrieving an element only if higher priority codes weren't found, but perhaps you could use this example to get closer to a solution. Good luck!
... View more