Member since
01-14-2016
13
Posts
4
Kudos Received
1
Solution
My Accepted Solutions
Title | Views | Posted |
---|---|---|
850 | 01-14-2016 12:31 PM |
07-11-2017
01:02 PM
Hi @Pavan Challa If I understand your use case correctly, I think I have come up with a groovy script to do the job. It loops through dataFlow elements, test if filePattern matches, then resolve path with ExpressionLanguage. Please check this Gist if it works for you: https://gist.github.com/ijokarumawak/a4ef40b49b45cecf3c43b56493683725 I had to change filePattern to be Regular Expression <filePattern>salary_*.gz</filePattern>
/* Added a dot before the star */
<filePattern>salary_.*.gz</filePattern> Hope this helps.
... View more
07-06-2017
02:59 PM
1 Kudo
@Pavan Challa There's an answer for a related question that should address this for you. See: https://community.hortonworks.com/questions/109613/nifi-lookupattribute-and-updateattributes.html and https://gist.github.com/jfrazee/26deffba3a7d50e991495e223a020b93
... View more
07-06-2017
02:55 PM
2 Kudos
@Pavan Challa I've created a template [1] that sketches out how to satisfy your use case. In it I used an ExecuteScript [2] to evaluate the attribute expression from the to.path in the XML file. I do think it'd be better/easier/more perspicuous to just set the directory in PutFile as `/var/tmp/${country}/${datasource}/csv` but figured it was worth showing you how you could do this anyway. The (default) expression engine for the lookups [3] is rather simple so you can't do conditional lookups like you're suggesting, but you can, however, do what you want using the index of the properties. There is a way to enable XPath in the underlying libraries but that'll require some internal code changes and won't help you immediately. 1. https://gist.github.com/jfrazee/26deffba3a7d50e991495e223a020b93#file-lookupattribute_xml_putfile_example-xmllookupattribute_xml_putfile_example-xml 2. https://gist.github.com/jfrazee/26deffba3a7d50e991495e223a020b93#file-evalexp-groovy 3. http://commons.apache.org/proper/commons-configuration/apidocs/org/apache/commons/configuration2/tree/DefaultExpressionEngine.html
... View more
05-20-2019
12:42 AM
Hi, @Shu, Can you please help me to find the value from xml file, below is the xml and i want to retrieve href value in bold/underlined, below is my response after invokeHttp. Here my requirement is to get next page URL and invoke next url to get new data and i get this new url at the end of xml flow-file. I want to loop into new URL until there is no data present in the source. <feed xmlns="http://www.w3.org/2005/Atom" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xml:base="https://xxx/"> <id>...</id> <title type="text">PartnerContactCollection</title> <updated>2019-05-17T04:28:07Z</updated> <author>...</author> <link href="PartnerContactCollection" rel="self" title="PartnerContactCollection"/> <entry m:etag="W/"datetimeoffset'2019-04-04T17%3A54%3A50.1540090Z'""> <id> https://xxx('00163E07D') </id> <title type="text"> PartnerContactCollection('00163E07D') </title> <updated>2019-05-17T04:28:07Z</updated> <category term="c4codata.PartnerContact" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme"/> <link href="PartnerContactCollection('00163E07D')" rel="edit" title="PartnerContact"/> <link href="PartnerContactCollection('00163E07D')/PartnerContactSalesResponsibility" rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/PartnerContactSalesResponsibility" type="application/atom+xml;type=feed" title="PartnerContactSalesResponsibility"/> <link href="PartnerContactCollection('00163E07D')/PartnerContactBusinessRoleAssignment" rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/PartnerContactBusinessRoleAssignment" type="application/atom+xml;type=feed" title="PartnerContactBusinessRoleAssignment"/> <content type="application/xml"> <m:properties> <d:UserID/> <d:CreateUser>false</d:CreateUser> <d:BusinessPartnerID>xxxx</d:BusinessPartnerID> <d:Z_CMAT_ID>xxxx</d:Z_CMAT_ID> </m:properties> </content> </entry> <link rel="next" href=" https://my2456.crm.ondemand.com/abc/c4c/xyz/v1/c4mnopqi/PthisChatCollect?$skiptoken=1001%20 "/> </feed>
... View more
01-14-2016
12:31 PM
1 Kudo
Apologies for the question. Found the solution. It was due to rack-topology.sh. We placed the correct file on Standby Node and everything is working fine now. Thanks.
... View more