Community Articles
Find and share helpful community-sourced technical articles
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.
Labels (1)
Contributor

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

send-to-syslog.xml

Send to Syslog Template Walkthrough :

The Flow is broken down into 3 sections

Section 1 : Test Data Generation

79518-screen-shot-2018-07-18-at-74906-pm.png

Section 2 : Processing (decompress files and send to local syslog)

79519-screen-shot-2018-07-18-at-74916-pm.png

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.

79521-screen-shot-2018-07-18-at-94937-pm.png

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).

79522-screen-shot-2018-07-18-at-95018-pm.png

Section 3 : Validation (receive syslog messages)

79520-screen-shot-2018-07-18-at-74925-pm.png


1,215 Views
Don't have an account?
Coming from Hortonworks? Activate your account here
Version history
Revision #:
2 of 2
Last update:
‎08-17-2019 06:56 AM
Updated by:
 
Contributors
Top Kudoed Authors