Member since
06-18-2018
39
Posts
0
Kudos Received
0
Solutions
10-21-2022
12:56 PM
@rangareddyy What is important to understand is that the NiFi component processors are not being executed by the user authenticated (assuming secured NiFi) into NiFi, but rather by the NiFi service user. So let's say that your NiFi service is owned by a "nifiservice" linux account. Whatever umask is configured for that user will be applied to directories and files create by that user. Now if your script is using sudo, it is changing the user that executes your script resulting in different user ownership and permission from the "nifiservice" user. Subsequent component processors will also execute as the "nifiservice" user and then not have access to those files and directories. So you'll need to take this in to account as you built your scripts. Make sure that your scripts are adjusting permissions on the directory tree and files as needed so your "nifiservice" user or all users can access the files needed downstream in your dataflows. So in yoru case it sounds like your script executed by ExecuteScript processor is creating a sh file not owned by the "nifiservice" user or does not have execute permission set on it. The ExecuteStreamCommand processor will attempt to execute the sh command on disk as the "nifiservice" user only. If you found that the provided solution(s) assisted you with your query, please take a moment to login and click Accept as Solution below each response that helped. Thank you, Matt
... View more
10-12-2022
07:57 PM
Hi Team, I am trying to calling jar utility in Nifi thru Execute Script processor groovy command like below. #1. when i give without double quotes in command java params, its taking java class and executing and giving output. #2. when i try to add double quotes to params inside java command, its not giving any output, its giving null pointer exception and main method not calling. #3. How to escape double quotes inside command and how to call the same in Nifi ? #4. Guys, please suggest me one below use case. flowFile = session.get() if(!flowFile) return try { def command = "java -cp \"/base_dir/poc/lib/dentine/*\" com.abc.xyz.Engine -f=\"/base_dir/input/abc.xlsx\" -o=\"/base_dir/output/\" -av_Log_Directory=\"/base_dir/logs/\" " def process = command.execute() def outputStream = new StringBuffer(); def errStream = new StringBuffer(); process.waitForProcessOutput(outputStream, errStream) flowFile = session.putAttribute(flowFile, "process.exitValue()" , process.exitValue().toString()) session.transfer(flowFile, REL_SUCCESS) } catch(e) { flowFile = session.putAttribute(flowFile, "SCRIPT_EXECUTION", "FAILED") flowFile = session.putAttribute(flowFile, "SCRIPT_ERROR_MESSAGE", e.getMessage()) session.transfer(flowFile, REL_FAILURE) }
... View more
Labels:
- Labels:
-
Apache NiFi
07-26-2022
08:36 AM
At moment you can not run stored procedure using ExecuteSQL, however, you can use ExecureScript to do the same with stored procedure wrapped in script with MySQL engine or any other client you can use please refer : https://community.cloudera.com/t5/Support-Questions/Does-ExecuteSQL-processor-allow-to-execute-stored-procedure/m-p/158922 If you found this response assisted with your issue, please take a moment to login and click on "Accept as Solution" below this post. Thank you
... View more
07-20-2022
08:23 AM
I think you will also need to do the transfer/commit in the each list logic
... View more
06-16-2022
07:44 PM
Hi Team, I just started working on the apache execute script processor. please help me on this. I am getting issues to read files from remote directory of multiple connections and pass all files to next processor. Here I can not use list processor since it is asking static host and port.. so I want to write groovy script to connect remote server and read all files and hand over them to next processor. My seniors suggested to write groovy script to complete this activity. I need help on how to connect remote server and read all files and how to add all files to flow file and how to hand over it to next processor ? Input parameters are 1) username 2) password 3) host 4) port 5) directory path Can you guys suggest me how to get this. Thanks, Rangareddy Y
... View more
Labels:
- Labels:
-
Apache NiFi
08-24-2018
04:03 AM
@Rangareddy Y you can take help of file filter.
... View more
08-21-2018
11:17 AM
@Steven Matison /homepath/customer_*/inbox/ is giving error. processor is invalid and getting directory does not exist error.
... View more
08-21-2018
06:52 AM
Thanks for the reply @Harald Berghoff can you suggest me how to give the input directory path in listFile processor for below scenario. lets assume these folders exists in local system. /homepath/ranga/inbox/ /homepath/krishna/inbox/ /homepath/kaja/inbox/ /homepath/jilebhi/inbox/ /homepath/laddu/inbox/ /homepath/bundhi/inbox/ like 100+ folders are there...i have used multiple listFile processor based on folder size files. lets assume, 3 listFile processors i used in my flow and want to configure perticular folders in listFile processor. in first listFile processor, i want to point (ranga, krishna) folder paths, in second listFile processor, i want to point (kaja, jilebhi) folder paths, in third listFile processor, i want to point (laddu, bundhi) folder paths, can you please suggest me how to achieve above case... Thanks, Rangareddy Y
... View more
08-03-2018
05:16 AM
can you send me the job runner code exact line with comment
... View more
06-29-2018
05:54 AM
@Bryan Bende Can you suggest me how to implement below scenario in nifi. 500+ partners used to send files to us thru SFTP. how to read all these sftp connections for files in nifi. if listSFTP does not support dynamic parameter change.. what is the alternate solution for this. Can you please give me flow of steps.. Thanks, Rangareddy Y
... View more