- Subscribe to RSS Feed
- Mark Question as New
- Mark Question as Read
- Float this Question for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
Passing file name to bash script in nifi?
- Labels:
-
Apache NiFi
Created ‎01-13-2023 12:17 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am uncertain on how to pass the file name from the GetFile process to a bash script so that we can call clamAV on it. I then need the result (success|failure) of the script passed back to nifi so we can route the flow. I can't seem to understand how to pass the arguments correctly or if I'm even using the correct process; ExecuteStreamCommand or ExecuteProcess. We had an sys architect designing this with us but he left, leaving behind a very complicated non-working example.
I thought I had configured an ExecuteProcess correctly but it doesn't allow me to connect GetFile to it.
Created ‎01-23-2023 06:52 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@phaelax ExecuteScript ExecuteProcess ExecuteStreamCommand etc are some of the hardest configs in nifi. It is very hard to give guidance without exact templates, configs, scripts, etc. That said, i would recommend ExecuteScript and python over bash. If that is interesting to. you, you should spend some time consuming the 3 part series on ExecuteScript by @MattWho . I believe the first part explains how to get flowfile attributes (filename) or flowfile content from previous processor flowfile (getFile) into the script.
https://community.hortonworks.com/articles/75032/executescript-cookbook-part-1.html
https://community.hortonworks.com/articles/75545/executescript-cookbook-part-2.html
https://community.hortonworks.com/articles/77739/executescript-cookbook-part-3.html
Created ‎01-23-2023 12:25 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@steven-matison That 3 part series on ExecuteScript was written by a very talented different Matt in this community @mburgess.
