Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

In NiFi how do I append RouteText lines to an existing target file (PutFile functionality)?

Solved Go to solution

In NiFi how do I append RouteText lines to an existing target file (PutFile functionality)?

Guru

I have a RouteText processor outputting matched lines that I would like to append to an existing local file using PutFile. However, PutFile cannot append content to an existing file (am I wrong?). How do I do this in NiFi? Is the only way to do it by using a script in ExecuteScript to open and append a file? Seems like a native Processor should do this.

1 ACCEPTED SOLUTION

Accepted Solutions

Re: In NiFi how do I append RouteText lines to an existing target file (PutFile functionality)?

@Greg Keys unfortunately I think you are correct that ExecuteScript is the best way to achieve this right now. As far as I know, the PutFile processor cannot append to an existing file. You are given the option to deal with conflicting files using "replace", "ignore", or "fail" as a resolution strategy. You should submit an Apache Jira to add this functionality. I could see difficulties with file locks and flushing the buffer given the streaming nature of NiFi and I think further investigation is needed.

1 REPLY 1

Re: In NiFi how do I append RouteText lines to an existing target file (PutFile functionality)?

@Greg Keys unfortunately I think you are correct that ExecuteScript is the best way to achieve this right now. As far as I know, the PutFile processor cannot append to an existing file. You are given the option to deal with conflicting files using "replace", "ignore", or "fail" as a resolution strategy. You should submit an Apache Jira to add this functionality. I could see difficulties with file locks and flushing the buffer given the streaming nature of NiFi and I think further investigation is needed.