Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

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

Solved Go to solution

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

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

Accepted Solutions
Highlighted

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

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

2 REPLIES 2
Highlighted

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

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

Highlighted

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

Explorer

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

Don't have an account?
Coming from Hortonworks? Activate your account here