Member since
11-16-2015
911
Posts
668
Kudos Received
249
Solutions
My Accepted Solutions
| Title | Views | Posted |
|---|---|---|
| 701 | 09-30-2025 05:23 AM | |
| 1074 | 06-26-2025 01:21 PM | |
| 930 | 06-19-2025 02:48 PM | |
| 1100 | 05-30-2025 01:53 PM | |
| 12279 | 02-22-2024 12:38 PM |
04-06-2018
11:00 PM
You use flowFileIn to get some attributes but don't use it later and don't transfer it either. The former means you'll break the provenance chain and the latter means you'll get an error since flowFileIn exists in the session. For the former, I recommend passing it into session.create(flowFileIn), such that the child flow file will inherit from the parent (keeping the provenance chain). For the latter, since you are transferring the child flow file, you can remove the incoming flow file with session.remove(flowFileIn) at the end of the script. I am just eyeballing the code so if that doesn't fix the errors please let me know and I'll edit my answer after running with your script and looking more at it.
... View more
04-06-2018
03:26 PM
What version of NiFi are you using? You should definitely be able to use it when it is specified in the Module Directory property. Alternatively, if you just need a Connection from the driver, you could create a DBCPConnectionPool that uses that JAR, then access that controller service to get a Connection. See my blog post and the documentation for ExecuteGroovyScript (which makes this a lot easier than the plain ExecuteScript).
... View more
04-06-2018
02:40 PM
You don't need to specify that parameter, in curl the -o lets you pick the destination of the output. In InvokeHttp the response will be in the content of the outgoing flow file. If you want to put that content into a file, you can use PutFile after InvokeHttp.
... View more
04-05-2018
11:26 PM
I think you should be able to provide "Authorization" in Attributes to Send, and have an attribute "Authorization" with value "Bearer [OAUTH2_TOKEN]", with that value replaced with the token (you can use UpdateAttribute with Expression Language to set all that up). Then you should be able to use the URL that works with curl. If that doesn't work, try an attribute with any name (say, "auth") with value "Authorization: Bearer [OAUTH2_TOKEN]" and include "auth" in the Attributes to Send property.
... View more
04-05-2018
01:16 PM
I used Groovy's findAll method for filtering/iterating in my example, you'd just have to use the Javascript idiom, maybe something like: for(var pdMap in context.getProperties()) { if(pd.getKey().isDynamic()) { // This is a user-defined "dynamic" property, the ExecuteScript properties won't show up here } } Having said that, if you are only using Javascript in order to parse JSON, you can keep Groovy and use JsonSlurper and JsonOutput and other handy classes for manipulating JSON objects.
... View more
04-05-2018
01:07 PM
You might be able to use jvm-npm as a bridge to load that module, but see the documentation on the jvm-npm site for restrictions (such as needing to be a "pure" NPM module that does not depend on the Node.js API)
... View more
04-03-2018
08:07 PM
1 Kudo
Can you ping that node and/or telnet to that port? It's also possible that even if you connect to the name node, that it will send back private IPs for data nodes, etc. In that case you may need to set the "dfs.datanode.use.datanode.hostname" property in hdfs-site.xml to "true" (see here for more information on that property). Lastly, what is the version of CDH that you are using, what version of Hadoop does it run, and what version of NiFi/HDF are you using? It is possible that Apache NiFi and/or HDF NiFi are built with Hadoop dependencies incompatible with your cluster. Additionally, HDF NiFi is built with HDP dependencies, so it is possible that HDF NiFi would not be compatible with CDH.
... View more
04-03-2018
06:41 PM
Did you get the client configs from Ambari, or just change your existing site files to use the public FQDN? If the latter, perhaps those ports are not exposed via the public FQDN, or perhaps are mapped to different ports for external access?
... View more
04-03-2018
06:30 PM
If you use Ambari to download the HDFS client configs, the site files you get should be correct for use in NiFi. I'm not sure where you got your site files, but they may have been server-side configs (to use private IPs/names) rather than client configs.
... View more
04-02-2018
01:49 PM
3 Kudos
You can access all the properties from the "context" variable, then filter on only the dynamic properties. You get a Map of PropertyDescriptors as keys to their values, so you can iterate over the keys to look for your property key(s). Here is a quick Groovy snippet that will log each dynamic property name: context.properties.findAll {k,v -> k.dynamic}.each {k,v -> log.info(k.name)}
... View more