问题
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