Member since
07-30-2019
3391
Posts
1618
Kudos Received
1000
Solutions
My Accepted Solutions
| Title | Views | Posted |
|---|---|---|
| 251 | 11-05-2025 11:01 AM | |
| 157 | 11-05-2025 08:01 AM | |
| 488 | 10-20-2025 06:29 AM | |
| 628 | 10-10-2025 08:03 AM | |
| 402 | 10-08-2025 10:52 AM |
05-25-2017
04:10 PM
@Max Evers There was a recent change to ListFile to change this exact same behavior. https://issues.apache.org/jira/browse/NIFI-3213 An apache Jira could be opened asking that the same change be adapted to listHDFS as well. Thanks, Matt
... View more
05-25-2017
02:55 PM
1 Kudo
@Max Evers Does the 1 file that is being left behind have the most recent timestamp of all files consumed? NiFi records state based on the timestamp of the most recent file listed. The problem that can occur is that if multiple files are being written in to the target location at the same time, they may not all make it into the listing being performed. So if NiFi recorded that timestamp in state, on next run those other files would not be listed and would never get fetched. So the idea is to list all files except those with the latest timestamp. In most cases, this is only 1 or 2 files not being listed. So what ends up being listed is all but any files with the same most current timestamp. This ensures that even when time differs between your NiFi server and target HDFS servers that all files get listed on next processor execution. Please let us know if you are seeing different behavior. Thanks, Matt
... View more
05-25-2017
12:46 PM
@Tinkle Mahendru How do you identify your files as containing CSV data without looking at each file's content? Does the filename indicate that it contains CSV data? Assuming all your csv files have a csv filename extension on them, you could use the routeOnAttribute processor to route on files whose filename ends in .csv to your mergeContent processor. All other FlowFiles with a filename not ending in .csv could then be routed elsewhere in your dataflow. You would add a new custom property as follows to the routeOnAttribute processor: Each added dynamic property becomes a new relationship for this processor. Lets say there is no extension, you may be able to use the RouteOnContent processor to look at the content of each FlowFile for an indicator that it is CSV data and route that way. Of course reading content versus evaluating attributes is more expensive operation in terms of resources. The MergeContent processor has virtual bins where it groups incoming FlowFiles before merging all the FlowFiles assigned to that bin. The Correlation Attribute property provides a way for you to control what FlowFile are put in which bin. FlowFiles are made up of FlowFile Attributes (key value pairs - basically metadata) and FlowFile content (your actual data). You can use various processors (ie. updateAttribute) to add and manipulate FlowFile attributes on a FlowFile. If you configure your MergeContent processor to use a correlation Attribute, NiFi will look for the attribute key you specify and bin files with the exact same value into the same virtual bin. I do not believe this is what you are looking for here to solve your use case. While there are scripting processor available in NiFi that can be used to execute your won script against a FlowFile, they are designed to operate against one FlowFile at a time. You could maybe use a putFile processor to write your CSV files to disk and the use one of the scripting processors to merge them. Another option to is to write your own custom NiFi processor that is specifically designed to merge CSV files. https://nifi.apache.org/docs/nifi-docs/html/developer-guide.html If you feel we have successfully answered your question, please mark an answer as accepted. Thank you, Matt
... View more
05-25-2017
12:05 PM
2 Kudos
@J. D. Bacolod Anything you can do within the NiFi UI, you can also do via NiFi Rest-api calls. So you could issue a rest-api call to stop specific processors before the batch job is started and then issue another rest-api call to start the processor again after the batch job completes. https://nifi.apache.org/docs/nifi-docs/rest-api/index.html Thanks, Matt
... View more
05-24-2017
01:52 PM
@Bhushan Babar Glad i was able to help resolve your issue. Could you please click "accept" the answer i provided to close out this question in the community? Thank you,
Matt
... View more
05-24-2017
12:57 PM
@Bhushan Babar And you have created a new user in your authorizer that matches the following exactly: cn=nifiuser+o=tp1+ou=business,dc=example,dc=com Thanks, Matt
... View more
05-24-2017
12:47 PM
1 Kudo
@Fawn Nguyen How are are the Files being moved to this directory. To understand what is happening here, let me explain how the listFile decides what files to list in a source directory. The List type processors all keep "state". It would be very expensive to record information about every File listed and then compare any new listing against that list each time a list based processor runs. So what is recorded in state management is the latest time stamp of the lats batch of files listed. So on next run the list based processors will only list files with newer timestamps and then update state again. It is my guess that the method which you are suing to "move" these new sets of files in to this directory is not resulting in a update of the file timestamp. So only the few files that actually have newer timestamps then what was last recorded in state are being listed. You will need to change how you are moving files in to this directory to make sure all the file's timestamps are updated. A move operation typically does not update the timestamp, but a copy will. Thanks, Matt
... View more
05-24-2017
12:28 PM
2 Kudos
@Alejandro A. You can use the replaceText processor to do this. It offers prepend and append replacement strategies. Just provide the name of the FlowFile Attribute you which to append or prepend in the "Replacement Value:" property of the processor in the form of a NiFi Expression Language statement. ${<flowfile-attribute-name>} Thanks, Matt
... View more
05-24-2017
12:20 PM
@Sunil Neurgaonkar Where the details I provided able to assist you in getting your authorization setup for your users? Can you please mark the answer accepted if it adddressed your original question. Thanks, Matt
... View more
05-24-2017
12:15 PM
@Muhammad Umar This Error is being thrown by your MoveFile.bash script and not by NiFi. NiFi is simply capturing the error response from the script and putting in tin the NiFi app log. Thanks, Matt
... View more