mattyb149 commented on a change in pull request #4299:
URL: https://github.com/apache/nifi/pull/4299#discussion_r433430043



##########
File path: 
nifi-nar-bundles/nifi-standard-services/nifi-record-serialization-services-bundle/nifi-record-serialization-services/src/main/java/org/apache/nifi/syslog/Syslog5424Reader.java
##########
@@ -59,18 +59,31 @@
 @CapabilityDescription("Provides a mechanism for reading RFC 5424 compliant 
Syslog data, such as log files, and structuring the data" +
         " so that it can be processed.")
 public class Syslog5424Reader extends SchemaRegistryService implements 
RecordReaderFactory {
+
     public static final String RFC_5424_SCHEMA_NAME = "default-5424-schema";
     static final AllowableValue RFC_5424_SCHEMA = new 
AllowableValue(RFC_5424_SCHEMA_NAME, "Use RFC 5424 Schema",
             "The schema will be the default schema per RFC 5424.");
+
+    static final String RAW_MESSAGE_NAME = "_raw";
+
     public static final PropertyDescriptor CHARSET = new 
PropertyDescriptor.Builder()
             .name("Character Set")
             .description("Specifies which character set of the Syslog 
messages")
             .required(true)
             .defaultValue("UTF-8")
             .addValidator(StandardValidators.CHARACTER_SET_VALIDATOR)
             .build();
+    public static final PropertyDescriptor ADD_RAW = new 
PropertyDescriptor.Builder()

Review comment:
       This property isn't added to the list of supported properties, so 
although it can be set for unit tests, it can't be set from the UI

##########
File path: 
nifi-nar-bundles/nifi-standard-services/nifi-record-serialization-services-bundle/nifi-record-serialization-services/src/main/java/org/apache/nifi/syslog/SyslogReader.java
##########
@@ -57,18 +57,31 @@
         "Note: Be mindfull that RFC3164 is informational and a wide range of 
different implementations are present in" +
         " the wild.")
 public class SyslogReader extends SchemaRegistryService implements 
RecordReaderFactory {
+
     public static final String GENERIC_SYSLOG_SCHEMA_NAME = 
"default-syslog-schema";
     static final AllowableValue GENERIC_SYSLOG_SCHEMA = new 
AllowableValue(GENERIC_SYSLOG_SCHEMA_NAME, "Use Generic Syslog Schema",
             "The schema will be the default Syslog schema.");
+
+    static final String RAW_MESSAGE_NAME = "_raw";
+
     public static final PropertyDescriptor CHARSET = new 
PropertyDescriptor.Builder()
             .name("Character Set")
             .description("Specifies which character set of the Syslog 
messages")
             .required(true)
             .defaultValue("UTF-8")
             .addValidator(StandardValidators.CHARACTER_SET_VALIDATOR)
             .build();
+    public static final PropertyDescriptor ADD_RAW = new 
PropertyDescriptor.Builder()

Review comment:
       Same here, the property isn't added to the list of supported property 
descriptors

##########
File path: 
nifi-nar-bundles/nifi-standard-services/nifi-record-serialization-services-bundle/nifi-record-serialization-services/src/main/java/org/apache/nifi/syslog/SyslogReader.java
##########
@@ -57,18 +57,31 @@
         "Note: Be mindfull that RFC3164 is informational and a wide range of 
different implementations are present in" +
         " the wild.")
 public class SyslogReader extends SchemaRegistryService implements 
RecordReaderFactory {
+
     public static final String GENERIC_SYSLOG_SCHEMA_NAME = 
"default-syslog-schema";
     static final AllowableValue GENERIC_SYSLOG_SCHEMA = new 
AllowableValue(GENERIC_SYSLOG_SCHEMA_NAME, "Use Generic Syslog Schema",
             "The schema will be the default Syslog schema.");
+
+    static final String RAW_MESSAGE_NAME = "_raw";
+
     public static final PropertyDescriptor CHARSET = new 
PropertyDescriptor.Builder()
             .name("Character Set")
             .description("Specifies which character set of the Syslog 
messages")
             .required(true)
             .defaultValue("UTF-8")
             .addValidator(StandardValidators.CHARACTER_SET_VALIDATOR)
             .build();
+    public static final PropertyDescriptor ADD_RAW = new 
PropertyDescriptor.Builder()
+            .displayName("Raw message")
+            .name("syslog-5424-reader-raw-message")
+            .description("If true, the record will have a " + RAW_MESSAGE_NAME 
+ " field containing the raw message")
+            .required(true)
+            .defaultValue("false")
+            .allowableValues("true", "false")
+            .build();
 
     private volatile SyslogParser parser;
+    private volatile static boolean includeRaw;

Review comment:
       This variable is never set so defaults to false, I think it needs a line 
like the Syslog5424Reader:
   
   `includeRaw = context.getProperty(ADD_RAW).asBoolean();`




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to