NIFI how to change uuid to file name

ぐ巨炮叔叔 提交于 2020-02-25 00:39:17

问题


I have some documents in XML format load into Marklogic. The PutMarkLogic URI attribute Name property default "uuid". How can I change it to file name.

Input Directory:

/input/ac01010.xml
/input/ac02010.xml
 ....

I have two processors below

GetFile ->PutMarkLogic

Want Marklogic display documents:

ac01010.xml
ac02010.xml

Thanks Andy and Ben. I have updated UpdateAttribute and PutMarkLogic properties in Nifi. it works.

UpdateAttribute:added ${filename}

PutMarkLogic Property:


回答1:


You can use an UpdateAttribute processor to populate the filename attribute with the value of the uuid attribute by adding a dynamic property with name filename and value ${uuid}.




回答2:


You cannot change the uuid of a FlowFile.. You can however, change the uuid attribute using UpdateAttribute as @Andy mentioned.

Seems from the code that it uses the uuid attribute. So you can just set property name of UpdateAttribute as uuid and value as ${filename} or just the filename you wish to put and it should do the job.



来源:https://stackoverflow.com/questions/54965798/nifi-how-to-change-uuid-to-file-name

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!