I don't think you can do it with PutSyslog, but if you can format the flow file contents to be a valid Syslog message (RFC 5424), then sending it with PutUDP to your Syslog server should work, since Syslog is a plain text protocol. The fields are just concatenated in a specific order, separated by spaces.

This is how PutSyslog formats the messages: https://github.com/apache/nifi/blob/main/nifi-extension-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/PutSyslog.java#L298

<PRIORITY> VERSION? TIMESTAMP HOSTNAME BODY

Regards,
Marton

On 2/15/25 10:05 PM, eran izhak wrote:

Hello NiFi community,

Im using the PutSyslog processor in Apache NiFi to send logs to a syslog server. I want to send the FlowFile content (which contains JSON data) as the message body, but it seems the processor requires the message body to come from an attribute.


Ive tried the following approaches without success:

1.Leaving the Message Body field empty

2.Using ${flowfile_content}

3.Using . or * or similar placeholders

4.Using an empty string or a space


The FlowFile content contains valid JSON data, but its not present as an attribute only in the FlowFile payload.


Interestingly, when I use the PutUDP processor, it works as expected and sends the JSON data correctly. However, this isnt the solution Im looking for, as I want to use PutSyslog to customize the syslog format according to the available options in the processor.


Is there a way to configure PutSyslog to send the actual FlowFile content as the message body without converting it into an attribute first?


Thanks in advance for your help!

Reply via email to