Github user markap14 commented on a diff in the pull request:

    https://github.com/apache/nifi/pull/2411#discussion_r164501376
  
    --- Diff: 
nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/ExtractGrok.java
 ---
    @@ -107,31 +120,70 @@
             .build();
     
         public static final PropertyDescriptor CHARACTER_SET = new 
PropertyDescriptor.Builder()
    -        .name("Character Set")
    +        .name(CHARACTER_SET_KEY)
             .description("The Character Set in which the file is encoded")
             .required(true)
             .addValidator(StandardValidators.CHARACTER_SET_VALIDATOR)
             .defaultValue("UTF-8")
             .build();
     
         public static final PropertyDescriptor MAX_BUFFER_SIZE = new 
PropertyDescriptor.Builder()
    -        .name("Maximum Buffer Size")
    +        .name(MAXIMUM_BUFFER_SIZE_KEY)
             .description("Specifies the maximum amount of data to buffer (per 
file) in order to apply the Grok expressions. Files larger than the specified 
maximum will not be fully evaluated.")
             .required(true)
             .addValidator(StandardValidators.DATA_SIZE_VALIDATOR)
             .addValidator(StandardValidators.createDataSizeBoundsValidator(0, 
Integer.MAX_VALUE))
             .defaultValue("1 MB")
             .build();
     
    -    public static final PropertyDescriptor NAMED_CAPTURES_ONLY = new 
PropertyDescriptor.Builder()
    -        .name("Named captures only")
    -        .description("Only store named captures from grok")
    +     public static final PropertyDescriptor NAMED_CAPTURES_ONLY = new 
PropertyDescriptor.Builder()
    +        .name(NAMED_CAPTURES_ONLY_KEY)
    +        .description("Only store named captures from grokList")
             .required(true)
             .allowableValues("true", "false")
             .addValidator(StandardValidators.BOOLEAN_VALIDATOR)
             .defaultValue("false")
             .build();
     
    +    public static final PropertyDescriptor BREAK_ON_FIRST_MATCH = new 
PropertyDescriptor.Builder()
    +        .name(SINGLE_MATCH_KEY)
    +        .description("Stop on first matched expression.")
    +        .required(true)
    +        .allowableValues("true", "false")
    +        .addValidator(StandardValidators.BOOLEAN_VALIDATOR)
    +        .defaultValue("true")
    +        .build();
    +
    +    public static final PropertyDescriptor RESULT_PREFIX = new 
PropertyDescriptor.Builder()
    +        .name(RESULT_PREFIX_KEY)
    +        .description("Value to prefix attribute results with (avoid 
collisions with existing properties)" +
    +                "\n\t (Does not apply when results returned as content)" +
    +                "\n\t (May be empty, the dot (.) separator is not 
implied)")
    +        .required(true)
    +        .defaultValue("grok.")
    +        .addValidator(Validator.VALID)
    +        .build();
    +
    +
    +    public static final PropertyDescriptor EXPRESSION_SEPARATOR = new 
PropertyDescriptor.Builder()
    --- End diff --
    
    This would break backward compatibility of this processor. It will be very 
common to have a comma in the Grok Expression, and this change would result in 
different behavior for the processor. If we use this approach, then we would 
have to make it an optional property (i.e., `required(false)`) and we would 
have to not set a default value.


---

Reply via email to