[ 
https://issues.apache.org/jira/browse/NIFI-4789?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16343719#comment-16343719
 ] 

ASF GitHub Bot commented on NIFI-4789:
--------------------------------------

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

    https://github.com/apache/nifi/pull/2411#discussion_r164503277
  
    --- Diff: 
nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/ExtractGrok.java
 ---
    @@ -156,14 +209,23 @@
     
             final List<PropertyDescriptor> _descriptors = new ArrayList<>();
             _descriptors.add(GROK_EXPRESSION);
    +        _descriptors.add(EXPRESSION_SEPARATOR);
             _descriptors.add(GROK_PATTERN_FILE);
             _descriptors.add(DESTINATION);
             _descriptors.add(CHARACTER_SET);
             _descriptors.add(MAX_BUFFER_SIZE);
             _descriptors.add(NAMED_CAPTURES_ONLY);
    +        _descriptors.add(RESULT_PREFIX);
    +        _descriptors.add(BREAK_ON_FIRST_MATCH);
    +        _descriptors.add(MATCHED_EXP_ATTR);
             descriptors = Collections.unmodifiableList(_descriptors);
         }
     
    +    private String resultPrefix = "";
    --- End diff --
    
    This is not thread-safe. Since each invocation of the Processor may use a 
different thread, we must ensure that any member variable is stored in a 
thread-safe manner. Given that these variables appear to be set only in the 
@OnScheduled method and are not mutable objects, it should be sufficient to 
mark them as volatile. It is probably best, though, to move them up in the 
codebase with the other member variables, as that's the de-facto standard with 
nifi processors.


> Enhance ExtractGrok processor to handle multiple grok expressions
> -----------------------------------------------------------------
>
>                 Key: NIFI-4789
>                 URL: https://issues.apache.org/jira/browse/NIFI-4789
>             Project: Apache NiFi
>          Issue Type: New Feature
>          Components: Core Framework
>    Affects Versions: 1.2.0, 1.5.0
>         Environment: all
>            Reporter: Charles Porter
>            Priority: Minor
>              Labels: features
>
> Many flows require running several grok expressions against an input to 
> correctly tag and extract data. using many separate grok processors to 
> accomplish this is unwieldy and hard to maintain.  Supporting multiple grok 
> expressions delimited by comma or user selected delimiter greatly simplifies 
> this.  
> Feature is coded and tested, ready for pull request, if feature is approved



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to