thichxai
thichxai

Reputation: 1133

NIFI how to change uuid to file name

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.

Nifi PutMarkLogic

UpdateAttribute:added ${filename} UpdateAttribute

PutMarkLogic Property: PutMarkLogic Property

Upvotes: 3

Views: 2486

Answers (2)

Ben Yaakobi
Ben Yaakobi

Reputation: 1658

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.

Upvotes: 2

Andy
Andy

Reputation: 14184

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}.

Upvotes: 3

Related Questions