Support Questions

Find answers, ask questions, and share your expertise

nifi dataflow - get result, parse it, and save to file

avatar
Explorer

Hello,

I want to create data flow to execute external command, get result from it, put it to file, parse it and save result to new file.

Can it be done using build-in processors? Or I should write my own?

For example I see that I can use: PutFile, ExecuteProcess,

but for parsing file using regexp expressions for example, I don't know how to do it.

Thank you very much for your help.

1 ACCEPTED SOLUTION

avatar
Super Collaborator
4 REPLIES 4

avatar
Super Collaborator

Take a look at the ExtractText processor and see if it meets your needs:

https://nifi.apache.org/docs/nifi-docs/components/org.apache.nifi.processors.standard.ExtractText/in...

avatar
Explorer

14935-screenshot-from-2017-04-28-18-38-12.png

I can't find where to add regexp patterns here.

avatar
Master Mentor
@Gu Gur

You can right click on any NiFi processor and select "usage" to get the complete documentation on that processor. Any processor documentation that states it supports "Dynamic Properties" will allow you to add additional properties in the documented format.

To add an additional property simply click on the following icon on the properties tab:

14917-screen-shot-2017-04-28-at-20131-pm.png

Thanks,

Matt

avatar
Super Collaborator

@Gu Gur And just to add a little detail to Matt's comment, from the documentation,

Regular Expressions are entered by adding user-defined properties; the name of the property maps to the Attribute Name into which the result will be placed.