tag:blogger.com,1999:blog-42869383794183737.post4310701937071879772..comments2024-03-09T01:04:10.400-08:00Comments on Fun with Apache NiFi: ExecuteScript processor - Hello World!MattyBhttp://www.blogger.com/profile/05049049725324531534noreply@blogger.comBlogger20125tag:blogger.com,1999:blog-42869383794183737.post-13043003046373539092020-03-02T03:12:17.649-08:002020-03-02T03:12:17.649-08:00Hi Matt,
i want to generate the flowfile using py...Hi Matt,<br /> i want to generate the flowfile using python can you please help me for this.Example i want to read the text file and i want to the read that file using python code and put that contents in another file.Anonymoushttps://www.blogger.com/profile/05890473676231055710noreply@blogger.comtag:blogger.com,1999:blog-42869383794183737.post-10932055503772385802018-11-22T04:12:06.065-08:002018-11-22T04:12:06.065-08:00Teradata is basically a database. The purpose of t...Teradata is basically a database. The purpose of teradatabase is for creating a table, column, row, domain, primary key etc. you can get further more information. <b><a href="https://onlineitguru.com/teradata-dba-online-training%20placement.html" title="Teradata DBA Online training|Teradata online course in India|OnlineITGuru" rel="nofollow">Teradata dba Online Training</a></b> <br />sivahttps://www.blogger.com/profile/11200327135161047349noreply@blogger.comtag:blogger.com,1999:blog-42869383794183737.post-58500368143352061912018-11-20T03:29:29.392-08:002018-11-20T03:29:29.392-08:00This comment has been removed by the author.sivahttps://www.blogger.com/profile/11200327135161047349noreply@blogger.comtag:blogger.com,1999:blog-42869383794183737.post-91323827519245023432018-03-13T07:29:10.141-07:002018-03-13T07:29:10.141-07:00HI Matt, could you please provide one example to f...HI Matt, could you please provide one example to fetch data from mysql , simple query like, select * from employeeAnonymoushttps://www.blogger.com/profile/03212448408767224982noreply@blogger.comtag:blogger.com,1999:blog-42869383794183737.post-26806402267710386962018-03-13T06:32:04.530-07:002018-03-13T06:32:04.530-07:00HI Matt, i want to connect mysql database and fetc...HI Matt, i want to connect mysql database and fetch data from tables , please suggest me i can write the code JAVA, as i know java. please suggect.Anonymoushttps://www.blogger.com/profile/03212448408767224982noreply@blogger.comtag:blogger.com,1999:blog-42869383794183737.post-70146579956965226622017-04-25T04:05:48.353-07:002017-04-25T04:05:48.353-07:00Hi Matt,
Could you please guide me an example for...Hi Matt,<br />Could you please guide me an example for parsing json file using ExecuteScript processor then using KafkaProducer to send data into topic. It is good if you use python script.<br />Thanks.Anonymoushttps://www.blogger.com/profile/03686775962990018211noreply@blogger.comtag:blogger.com,1999:blog-42869383794183737.post-16290722276254201962017-03-23T19:15:16.220-07:002017-03-23T19:15:16.220-07:00It shouldn't, the classloader gets set up rega...It shouldn't, the classloader gets set up regardless of whether it is a script body or file that is provided, and if a file is provided it just reads the whole thing in as a String as if it were the Script Body parameter. What error(s) do you get when trying to run as an external file? Do you have a cluster of NiFi instances? If so, is that script available to all of them?MattyBhttps://www.blogger.com/profile/05049049725324531534noreply@blogger.comtag:blogger.com,1999:blog-42869383794183737.post-48671098679348388632017-03-23T19:02:56.853-07:002017-03-23T19:02:56.853-07:00Matt
I have written a groovy scrpt which uploads...Matt<br /> I have written a groovy scrpt which uploads large files into oracle's clob column. The stuff works only if the groovy script is posted into the body of the execute script processor . If I try to use the same code as a standard external script the processor fails. I am not including any directories when I try this as a external script. Do I need to introduce something more in the groovy script , to make it run as a standard script ?Kannanhttps://www.blogger.com/profile/00702954474046517701noreply@blogger.comtag:blogger.com,1999:blog-42869383794183737.post-58189643679009893052017-03-21T17:12:47.129-07:002017-03-21T17:12:47.129-07:00ThanksThanksKannanhttps://www.blogger.com/profile/00702954474046517701noreply@blogger.comtag:blogger.com,1999:blog-42869383794183737.post-16721160700472577572017-03-20T09:49:31.773-07:002017-03-20T09:49:31.773-07:00flowFile = session.putAttribute(flowFile, 'DBS...flowFile = session.putAttribute(flowFile, 'DBSQLRESULT',"${numberRowsUpdated}".toString()) ;MattyBhttps://www.blogger.com/profile/05049049725324531534noreply@blogger.comtag:blogger.com,1999:blog-42869383794183737.post-78186557665001421242017-03-20T09:38:43.090-07:002017-03-20T09:38:43.090-07:00What is the right way to assign a groovy variable ...What is the right way to assign a groovy variable value to a flow file attribute.<br /><br />Here is a trivial code snippet <br />def sql = Sql.newInstance("jdbc:oracle:thin:@192.168.1.211:1522:mydb", "myuser", "mypassword", "oracle.jdbc.pool.OracleDataSource");<br />def updateStr = "update tblflowfiles set stage='GROOVY'" <br />def numberRowsUpdated = sql.executeUpdate(updateStr)<br />sql.close();<br />--getting errors due to these two statements below, but when passing direct single quoted string it works.<br />--the errors hint at No Signature of Method.<br />flowFile = session.putAttribute(flowFile, 'DBSQLRESULT',"${numberRowsUpdated.toString()}") ;<br />flowFile = session.putAttribute(flowFile, 'DBSQLRESULTSTMNT',"${updateStr.toString()}") ;Kannanhttps://www.blogger.com/profile/00702954474046517701noreply@blogger.comtag:blogger.com,1999:blog-42869383794183737.post-75732737429989402142017-03-14T02:07:45.661-07:002017-03-14T02:07:45.661-07:00Hi Matt,
I am using lua with ExecuteScript,but i a...Hi Matt,<br />I am using lua with ExecuteScript,but i am must get the flowFile from upstream for use session:get() and then i must deal with the flowFile,in the end write the flowFile to the downstream,can you help me and give me a simple example.Thank You!!Anonymoushttps://www.blogger.com/profile/13662260914160321364noreply@blogger.comtag:blogger.com,1999:blog-42869383794183737.post-3852159509942650462016-09-21T06:58:39.616-07:002016-09-21T06:58:39.616-07:00I have a case not sure if you can help me with , h...I have a case not sure if you can help me with , have 20 SFTP source that i should get 5 files from each and merge each 5 into 1 file , i ran this process using LISTSFTP , fetshsftp , mergecontent , updateattribute(to change the filename attribute) and putfile (to store the outputfile) but all of this is connecting to one server <br />the question : <br />1- how can i make it work each time for a new server <br />2- how can we make the LISTSFTP pull old files as well (ListSFTP will only pull files that were modified after its last run , but sometimes we get old files a bit late e, is there a way to change LISTSFTP so it doesnt reject these files , maybe by checking file names instead of the modified date <br />Unknownhttps://www.blogger.com/profile/15382709911316850025noreply@blogger.comtag:blogger.com,1999:blog-42869383794183737.post-56491908807039312602016-08-23T05:44:57.028-07:002016-08-23T05:44:57.028-07:00Matt - thanks for responding - I have been using S...Matt - thanks for responding - I have been using SplitText - and some RegExp (but thats not for the faint of heart).....for delimited, I think I now have a pretty good handle on it...but its still tough with large data sets as I need to account for the splits in HDFS (and whether a newline or delim is in a record that spans splits - is a good challenge).<br /><br />I am not trying to parse and normalize some XML....then some Cobol based EBCDIC files......will keep you posted...<br /><br />Thanks again....Anonymoushttps://www.blogger.com/profile/15825303331263880021noreply@blogger.comtag:blogger.com,1999:blog-42869383794183737.post-22009548858146033012016-08-22T15:49:02.210-07:002016-08-22T15:49:02.210-07:00Sure! What did you have in mind? Are you trying to...Sure! What did you have in mind? Are you trying to parse CSV or another delimited format looking for embedded characters that might also be delimiters? If you can represent what you want as a regular expression, you probably don't need a scripting processor and could use the SplitText processor instead.MattyBhttps://www.blogger.com/profile/05049049725324531534noreply@blogger.comtag:blogger.com,1999:blog-42869383794183737.post-15991038991090562182016-08-22T15:19:42.252-07:002016-08-22T15:19:42.252-07:00Hi matt - great stuff here....I have started to pl...Hi matt - great stuff here....I have started to play in Nifi quite a bit....one thing I can't figure out yet - is how to get some complex field level validations going...such as finding an embedded delimiter or even control chars like a new line...(\n).....any thoughts / advice?<br /><br />Thanks....<br /><br />BobAnonymoushttps://www.blogger.com/profile/15825303331263880021noreply@blogger.comtag:blogger.com,1999:blog-42869383794183737.post-86294896102291305372016-07-14T06:28:26.241-07:002016-07-14T06:28:26.241-07:00What format is your text file in? CSV? In any case...What format is your text file in? CSV? In any case there is an example on selecting certain fields from a bar-delimited ( | ) text file in my other post: http://funnifi.blogspot.com/2016/02/executescript-explained-split-fields.htmlMattyBhttps://www.blogger.com/profile/05049049725324531534noreply@blogger.comtag:blogger.com,1999:blog-42869383794183737.post-3924698290847943632016-07-13T01:41:00.323-07:002016-07-13T01:41:00.323-07:00Hi Matt,
Could you please provide me code for par...Hi Matt,<br /><br />Could you please provide me code for parsing text file using ExecuteScript processor as I need to extract only few fields instead of all in each and every recordAnonymoushttps://www.blogger.com/profile/16846531616590276532noreply@blogger.comtag:blogger.com,1999:blog-42869383794183737.post-21502037443369870902016-04-26T10:39:29.617-07:002016-04-26T10:39:29.617-07:00Because the code needs to be in a scripting proces...Because the code needs to be in a scripting processor, I didn't see the value in putting the snippets in GitHub by themselves. However all the scripts are available as NiFi templates on my GitHub Gist: https://gist.github.com/mattyb149MattyBhttps://www.blogger.com/profile/05049049725324531534noreply@blogger.comtag:blogger.com,1999:blog-42869383794183737.post-9390252481704229312016-04-26T10:30:45.636-07:002016-04-26T10:30:45.636-07:00Hello Matt,
Could you please share all these sampl...Hello Matt,<br />Could you please share all these samples in github?ShivShankarhttps://www.blogger.com/profile/07591503182826759649noreply@blogger.com