Created on 07-19-201804:37 AM - edited 08-17-201906:56 AM
A quick example NiFi flow to demonstrate sending logs to syslog from NiFi.
Steps:
1. Wait for new compressed files (gz) to land in folder (/tmp/nifi/syslog/src/*.gz) with log lines.
2. Decompress the file
3. Split the file into individual lines
4. Send data to syslog
NiFi Template : Download the following NiFi template and import the flow into your NiFi instance. Instructions to import a NiFi template is available here - Importing NiFi templates
Section 2 : Processing (decompress files and send to local syslog)
Key Highlights
ExtractText Processor :
We are using the extract text processor to get the content of the flowfile into the flowfile attribute "msg". We are grabbing the entire content of the flowfile into "msg" by using the regular expression (.*). You may get only specific fields by providing appropriate regular expression here.
PutSyslog processor :
We are using the flowfile attribute ${msg} in the syslog message body. We have also prefixed string "NifiLogger" to the syslog message (optional).