Archives of Support Questions (Read Only)

This is an archived board for historical reference. Information and links may no longer be available or relevant
Announcements
This board is archived and read-only for historical reference. To ask a new question, please post a new topic on the appropriate active board.

How to create a new attribute with value as the content of the flowfile?

avatar

I am using PutSyslog and need to pass in the content of the flow file.

Q 1 - Is there a way to reference the content of flow file directly within the MessageBody field of the PutSyslog processor?

Q 2 - If not, how do I add the content of the flow file as processor so that I can pass the attribute to the MessageBody?

1 ACCEPTED SOLUTION

avatar
Master Guru

The ExtractText processor is used to pull up text from the content of a flow file into an attribute. You should be able to add a property like "message.body" with a value of "(.*)" to ExtractText to get it to extract everything.

Keep in mind this only makes sense for small messages. Attributes are held in memory and if you did this with a huge flow file you could blow up the memory of your Java process.

View solution in original post

3 REPLIES 3

avatar
Master Guru

The ExtractText processor is used to pull up text from the content of a flow file into an attribute. You should be able to add a property like "message.body" with a value of "(.*)" to ExtractText to get it to extract everything.

Keep in mind this only makes sense for small messages. Attributes are held in memory and if you did this with a huge flow file you could blow up the memory of your Java process.

avatar
Explorer

This resulted in error: "message.body is invalid when validated against (.*) because message.body is not supported property"

avatar

Just for clarification you have to use this now - (?s)(^.*$)